summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resource_dispatcher_host.cc
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-09 00:11:52 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-09 00:11:52 +0000
commit484717318007195243bc66d77bfd567e9c2e5802 (patch)
tree7faa13a33a58243dc167b8323969b9df7e296061 /chrome/browser/resource_dispatcher_host.cc
parenteea6c68b97781f1a8bf1541119ef3921a659c11f (diff)
downloadchromium_src-484717318007195243bc66d77bfd567e9c2e5802.zip
chromium_src-484717318007195243bc66d77bfd567e9c2e5802.tar.gz
chromium_src-484717318007195243bc66d77bfd567e9c2e5802.tar.bz2
Adding a CHECK in a memcpy that it is not trivial to understand.
Review URL: http://codereview.chromium.org/1630 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1883 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resource_dispatcher_host.cc')
-rw-r--r--chrome/browser/resource_dispatcher_host.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/browser/resource_dispatcher_host.cc b/chrome/browser/resource_dispatcher_host.cc
index ae3ef20..adcda4c 100644
--- a/chrome/browser/resource_dispatcher_host.cc
+++ b/chrome/browser/resource_dispatcher_host.cc
@@ -1062,10 +1062,10 @@ bool ResourceDispatcherHost::BufferedEventHandler::CompleteResponseStarted(
if (bytes_read_) {
// a Read has already occurred and we need to copy the data into the
// DownloadEventHandler.
- char *buf;
- int buf_len;
+ char *buf = NULL;
+ int buf_len = 0;
download_handler->OnWillRead(request_id, &buf, &buf_len, bytes_read_);
- DCHECK(buf_len >= bytes_read_);
+ CHECK((buf_len >= bytes_read_) && (bytes_read_ >= 0));
memcpy(buf, read_buffer_, bytes_read_);
}
// Update the renderer with the response headers which will cause it to