summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 18:29:54 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-28 18:29:54 +0000
commitc3695f52f73e58926df35ba2c682701045d2672b (patch)
treef1508c40228708a529782bf5b652b8ac45af5fd4 /net/http
parent3e385813102ae53f3422f6d9f8b429ca8586ee98 (diff)
downloadchromium_src-c3695f52f73e58926df35ba2c682701045d2672b.zip
chromium_src-c3695f52f73e58926df35ba2c682701045d2672b.tar.gz
chromium_src-c3695f52f73e58926df35ba2c682701045d2672b.tar.bz2
Minor defense-in-depth tweak. end - start + 1 can actually go negative if
start==0 and end==9223372036854775807, i.e. the full positive range of a 64-bit signed int. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/346003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/partial_data.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/http/partial_data.cc b/net/http/partial_data.cc
index 57985e7..128c5b7 100644
--- a/net/http/partial_data.cc
+++ b/net/http/partial_data.cc
@@ -193,7 +193,7 @@ bool PartialData::ResponseHeadersOK(const HttpResponseHeaders* headers) {
return false;
int64 content_length = headers->GetContentLength();
- if (content_length != end - start + 1)
+ if (content_length < 0 || content_length != end - start + 1)
return false;
if (!resource_size_) {