Browse Source

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
xry
Chris Mumford 5 years ago
committed by Victor Costan
parent
commit
2ccb45c33a
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      table/table_test.cc

+ 1
- 1
table/table_test.cc View File

@ -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()) {

Loading…
Cancel
Save