diff options
author | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 21:12:50 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 21:12:50 +0000 |
commit | 5ed64d5f85cc2d2381748116374967f0cf5042d2 (patch) | |
tree | 2fd7b9d21bcffa7c6f501e5e6c4bd90f7f5d02f1 /net | |
parent | 5bbf411688635e93420f4c7d2379207fd0c29e69 (diff) | |
download | chromium_src-5ed64d5f85cc2d2381748116374967f0cf5042d2.zip chromium_src-5ed64d5f85cc2d2381748116374967f0cf5042d2.tar.gz chromium_src-5ed64d5f85cc2d2381748116374967f0cf5042d2.tar.bz2 |
Try to find the cause of the crash in memcpy, called from DoSendBody.
BUG=27870
TEST=none
Review URL: http://codereview.chromium.org/404034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32544 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/upload_data_stream.cc | 3 | ||||
-rw-r--r-- | net/http/http_stream_parser.cc | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/net/base/upload_data_stream.cc b/net/base/upload_data_stream.cc index 7a97846..d22929a 100644 --- a/net/base/upload_data_stream.cc +++ b/net/base/upload_data_stream.cc @@ -26,7 +26,8 @@ UploadDataStream::~UploadDataStream() { } void UploadDataStream::DidConsume(size_t num_bytes) { - DCHECK(num_bytes <= buf_len_); + // TODO(vandebo): Change back to a DCHECK when issue 27870 is resolved. + CHECK(num_bytes <= buf_len_); buf_len_ -= num_bytes; if (buf_len_) diff --git a/net/http/http_stream_parser.cc b/net/http/http_stream_parser.cc index f392cef..28d8534 100644 --- a/net/http/http_stream_parser.cc +++ b/net/http/http_stream_parser.cc @@ -128,7 +128,7 @@ int HttpStreamParser::DoLoop(int result) { if (result < 0) can_do_more = false; else - result = DoSendBody(result); + result = DoSendBody(result); TRACE_EVENT_END("http.write_body", request_, request_->url.spec()); break; case STATE_REQUEST_SENT: @@ -192,7 +192,8 @@ int HttpStreamParser::DoSendHeaders(int result) { } int HttpStreamParser::DoSendBody(int result) { - request_body_->DidConsume(result); + if (result > 0) + request_body_->DidConsume(result); if (request_body_->position() < request_body_->size()) { int buf_len = static_cast<int>(request_body_->buf_len()); |