summaryrefslogtreecommitdiffstats
path: root/net/disk_cache
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 23:19:45 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-21 23:19:45 +0000
commit9b845c6e367d95c442940578bfc18559d86ec52c (patch)
tree2fa4ac14ee4f750178af4fddde20f528a819871b /net/disk_cache
parent701764b18d5102dc28ca8829a810cda61028c2f9 (diff)
downloadchromium_src-9b845c6e367d95c442940578bfc18559d86ec52c.zip
chromium_src-9b845c6e367d95c442940578bfc18559d86ec52c.tar.gz
chromium_src-9b845c6e367d95c442940578bfc18559d86ec52c.tar.bz2
Coverity: Check for negative lseek return valies in disk_cache::File::GetLength.
BUG=none TEST=none CID=11651 Review URL: http://codereview.chromium.org/7218019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89925 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache')
-rw-r--r--net/disk_cache/file_posix.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/disk_cache/file_posix.cc b/net/disk_cache/file_posix.cc
index 087ff13..6f78b7a 100644
--- a/net/disk_cache/file_posix.cc
+++ b/net/disk_cache/file_posix.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -260,7 +260,9 @@ bool File::SetLength(size_t length) {
size_t File::GetLength() {
DCHECK(init_);
- size_t ret = lseek(platform_file_, 0, SEEK_END);
+ off_t ret = lseek(platform_file_, 0, SEEK_END);
+ if (ret < 0)
+ return 0;
return ret;
}