Commit 6d5624ec authored by gavinp@chromium.org's avatar gavinp@chromium.org

Fix URLRequestJobAbortOnEndJob::ReadRawData

I flipped min/max in my initial checkin, and ASAN went crazy.  This
fixes that.

BUG=103370


Review URL: http://codereview.chromium.org/8540011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109683 0039d316-1c4b-4281-b951-d872f2087c98
parent d88bc601
...@@ -90,7 +90,7 @@ bool URLRequestAbortOnEndJob::ReadRawData(net::IOBuffer* buf, ...@@ -90,7 +90,7 @@ bool URLRequestAbortOnEndJob::ReadRawData(net::IOBuffer* buf,
const int max_bytes, const int max_bytes,
int* bytes_read) { int* bytes_read) {
if (!sent_data_) { if (!sent_data_) {
*bytes_read = std::max(size_t(max_bytes), sizeof(kPageContent)); *bytes_read = std::min(size_t(max_bytes), sizeof(kPageContent));
std::memcpy(buf->data(), kPageContent, *bytes_read); std::memcpy(buf->data(), kPageContent, *bytes_read);
sent_data_ = true; sent_data_ = true;
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment