diff options
author | Adrian Lees <adrian@aemulor.com> | 2005-07-16 16:23:08 +0000 |
---|---|---|
committer | Adrian Lees <adrian@aemulor.com> | 2005-07-16 16:23:08 +0000 |
commit | dbcfa470c4203d59f5981596686b8a82a3092da3 (patch) | |
tree | fefd6f10cd49dc8cb8b10437e3c2ab912acdd335 | |
parent | 23465f5705c031943510981eed6642811963c406 (diff) | |
download | netsurf-dbcfa470c4203d59f5981596686b8a82a3092da3.tar.gz netsurf-dbcfa470c4203d59f5981596686b8a82a3092da3.tar.bz2 |
[project @ 2005-07-16 16:23:08 by adrianl]
Bounds checking in Content-Length handling
svn path=/import/netsurf/; revision=1799
-rw-r--r-- | content/fetch.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/content/fetch.c b/content/fetch.c index 2b9ced728..6d1b86a42 100644 --- a/content/fetch.c +++ b/content/fetch.c @@ -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) { |