1
0
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:
Karl Heyes 2004-08-10 00:03:14 +00:00
parent dac2723dbe
commit ebebad5e74

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