[project @ 2005-07-16 16:23:08 by adrianl]

Bounds checking in Content-Length handling

svn path=/import/netsurf/; revision=1799
This commit is contained in:
Adrian Lees 2005-07-16 16:23:08 +00:00
parent 23465f5705
commit dbcfa470c4

View File

@ -741,7 +741,7 @@ size_t fetch_curl_header(char *data, size_t size, size_t nmemb,
/* extract Content-Length header */
for (i = 15; i < (int)size && (data[i] == ' ' || data[i] == '\t'); i++)
/* */;
if ('0' <= data[i] && data[i] <= '9')
if (i < (int)size && '0' <= data[i] && data[i] <= '9')
f->content_length = atol(data + i);
#ifdef WITH_AUTH
} else if (16 < size && strncasecmp(data, "WWW-Authenticate", 16) == 0) {