浏览代码

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
master
Chris Mumford 5 年前
committed by Victor Costan
父节点
当前提交
2ccb45c33a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      table/table_test.cc

+ 1
- 1
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()) {

正在加载...
取消
保存