summaryrefslogtreecommitdiffstats
path: root/net/http/http_chunked_decoder.cc
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 04:58:34 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-18 04:58:34 +0000
commit9d65ad87c64ec57473b42ed290472ddec99e55c6 (patch)
treed6f04f97dfa552de5e4f1fb061bede79c8a00cdb /net/http/http_chunked_decoder.cc
parentfc1124064b408b4be6c4302f9b2040d4fe5dbf77 (diff)
downloadchromium_src-9d65ad87c64ec57473b42ed290472ddec99e55c6.zip
chromium_src-9d65ad87c64ec57473b42ed290472ddec99e55c6.tar.gz
chromium_src-9d65ad87c64ec57473b42ed290472ddec99e55c6.tar.bz2
Improve chunked encoding parsing.
R=abarth BUG=14508 TEST=HttpChunkedDecoderTest.ExcessiveChunkLen Patch contributed by Chris Evans. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18687 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_chunked_decoder.cc')
-rw-r--r--net/http/http_chunked_decoder.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/http/http_chunked_decoder.cc b/net/http/http_chunked_decoder.cc
index e030dc0..6ecdcad 100644
--- a/net/http/http_chunked_decoder.cc
+++ b/net/http/http_chunked_decoder.cc
@@ -125,7 +125,8 @@ int HttpChunkedDecoder::ScanForChunkRemaining(const char* buf, int buf_len) {
if (index_of_semicolon != StringPiece::npos)
buf_len = static_cast<int>(index_of_semicolon);
- if (!ParseChunkSize(buf, buf_len, &chunk_remaining_)) {
+ if (!ParseChunkSize(buf, buf_len, &chunk_remaining_) ||
+ chunk_remaining_ < 0) {
DLOG(ERROR) << "Failed parsing HEX from: " <<
std::string(buf, buf_len);
return ERR_INVALID_CHUNKED_ENCODING;