mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
add extra boundary checks when splitting headers
svn path=/icecast/trunk/httpp/; revision=7507
This commit is contained in:
parent
dac2723dbe
commit
ebebad5e74
@ -73,6 +73,8 @@ static int split_headers(char *data, unsigned long len, char **line)
|
|||||||
if (data[i] == '\n') {
|
if (data[i] == '\n') {
|
||||||
lines++;
|
lines++;
|
||||||
data[i] = '\0';
|
data[i] = '\0';
|
||||||
|
if (lines >= MAX_HEADERS)
|
||||||
|
return MAX_HEADERS;
|
||||||
if (i + 1 < len) {
|
if (i + 1 < len) {
|
||||||
if (data[i + 1] == '\n' || data[i + 1] == '\r')
|
if (data[i + 1] == '\n' || data[i + 1] == '\r')
|
||||||
break;
|
break;
|
||||||
@ -82,7 +84,7 @@ static int split_headers(char *data, unsigned long len, char **line)
|
|||||||
}
|
}
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
while (data[i] == '\n') i++;
|
while (i < len && data[i] == '\n') i++;
|
||||||
|
|
||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user