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