Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: webkit/blob/blob_url_request_job.cc

Issue 10536062: Fix int overflow in blob_url_request_job when we read files > 2GB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/blob/blob_url_request_job.cc
diff --git a/webkit/blob/blob_url_request_job.cc b/webkit/blob/blob_url_request_job.cc
index e0ca156b7b8e60b86189747d162b380e629bc8c8..2fda6b57c35e5ddb6f49e34abb0cce1261759c3d 100644
--- a/webkit/blob/blob_url_request_job.cc
+++ b/webkit/blob/blob_url_request_job.cc
@@ -414,8 +414,10 @@ int BlobURLRequestJob::ComputeBytesToRead() const {
item_length_list_[current_item_index_] - current_item_offset_;
int64 remaining_bytes = std::min(current_item_remaining_bytes,
remaining_bytes_);
- return std::min(read_buf_->BytesRemaining(),
- static_cast<int>(remaining_bytes));
+
+ return static_cast<int>(std::min(
+ static_cast<int64>(read_buf_->BytesRemaining()),
+ remaining_bytes));
}
bool BlobURLRequestJob::ReadLoop(int* bytes_read) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698