summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 20:37:32 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 20:37:32 +0000
commite547e0ccf59ff5815558d4c2ec8f4b0a92c5dcd7 (patch)
tree16d98c345595127a4de1a7e79d47ddde807a5ab2 /net
parentd6f61a3221f0abf8ed723ef0fcc8cb6762c02473 (diff)
downloadchromium_src-e547e0ccf59ff5815558d4c2ec8f4b0a92c5dcd7.zip
chromium_src-e547e0ccf59ff5815558d4c2ec8f4b0a92c5dcd7.tar.gz
chromium_src-e547e0ccf59ff5815558d4c2ec8f4b0a92c5dcd7.tar.bz2
Fix crash if we get an EOF after a large packet with unterminated headers.
Make sure we always start copying excess data to the start of the read buffer, even in the case where save_amount==0 and additional_save_amount!=0 BUG=27509 TEST=NONE Review URL: http://codereview.chromium.org/385088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31939 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/http/http_stream_parser.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc
index 33f1376..f392cef 100644
--- a/net/http/http_stream_parser.cc
+++ b/net/http/http_stream_parser.cc
@@ -388,8 +388,8 @@ int HttpStreamParser::DoReadBodyComplete(int result) {
if (save_amount) {
memcpy(read_buf_->StartOfBuffer(), user_read_buf_->data() + result,
save_amount);
- read_buf_->set_offset(save_amount);
}
+ read_buf_->set_offset(save_amount);
if (additional_save_amount) {
memmove(read_buf_->data(),
read_buf_->StartOfBuffer() + read_buf_unused_offset_,