diff options
author | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-20 22:21:48 +0000 |
---|---|---|
committer | rvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-20 22:21:48 +0000 |
commit | bda0ae08d22c0ef53656ddf9ababb6304cba7502 (patch) | |
tree | 92e364ce5f732351c3a0d37d46f23022b721f77e /net/disk_cache | |
parent | 806977eadacd4d685575d2d590298ab648258f2f (diff) | |
download | chromium_src-bda0ae08d22c0ef53656ddf9ababb6304cba7502.zip chromium_src-bda0ae08d22c0ef53656ddf9ababb6304cba7502.tar.gz chromium_src-bda0ae08d22c0ef53656ddf9ababb6304cba7502.tar.bz2 |
Disk cache: Fix overflow detection for sparse entries.
BUG=328231
TEST=none
R=cpu@chromium.org
Review URL: https://codereview.chromium.org/108583005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242191 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r-- | net/disk_cache/sparse_control.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/disk_cache/sparse_control.cc b/net/disk_cache/sparse_control.cc index b96ccc9..1fd4fda 100644 --- a/net/disk_cache/sparse_control.cc +++ b/net/disk_cache/sparse_control.cc @@ -252,8 +252,10 @@ int SparseControl::StartIO(SparseOperation op, int64 offset, net::IOBuffer* buf, return net::ERR_INVALID_ARGUMENT; // We only support up to 64 GB. - if (offset + buf_len >= 0x1000000000LL || offset + buf_len < 0) + if (static_cast<uint64>(offset) + static_cast<unsigned int>(buf_len) >= + GG_UINT64_C(0x1000000000)) { return net::ERR_CACHE_OPERATION_NOT_SUPPORTED; + } DCHECK(!user_buf_.get()); DCHECK(user_callback_.is_null()); |