1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-06-16 06:15:24 +00:00

add extra boundary checks when splitting headers

svn path=/icecast/trunk/httpp/; revision=7507
This commit is contained in:
Karl Heyes 2004-08-10 00:03:14 +00:00
parent 265752a303
commit d85ee1db3f

View File

@ -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;
}