diff options
author | Chris Mumford <cmumford@google.com> | 2019-04-15 15:11:03 -0700 |
---|---|---|
committer | Victor Costan <pwnall@chromium.org> | 2019-04-23 11:23:51 -0700 |
commit | 2ccb45c33aecd8b15000c0c622f45eb119b6b478 (patch) | |
tree | 7353813f52335372d53368553913325e96e4b75c /table | |
parent | 7b1174519044339f07a023dc445b0d36425bd6db (diff) | |
download | leveldb-2ccb45c33aecd8b15000c0c622f45eb119b6b478.tar.gz |
Check for possibly invalid offset in test.
Fix a possible array bounds offset issue flagged in
issue #668. Not the source of any known bug, but will
silence any static analyzers.
PiperOrigin-RevId: 243697659
Diffstat (limited to 'table')
-rw-r--r-- | table/table_test.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/table/table_test.cc b/table/table_test.cc index e47db3d..5573be6 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -119,7 +119,7 @@ class StringSource: public RandomAccessFile { virtual Status Read(uint64_t offset, size_t n, Slice* result, char* scratch) const { - if (offset > contents_.size()) { + if (offset >= contents_.size()) { return Status::InvalidArgument("invalid Read offset"); } if (offset + n > contents_.size()) { |