Fix off-by-one bug in VersionStorageInfo::ComputeFilesMarkedForForcedBlobGC (#9542)

Summary:
Fixes a bug introduced in https://github.com/facebook/rocksdb/issues/9526 where we index one position past the
end of a `vector`.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9542

Test Plan:
`make asan_check`

Will add a unit test in a separate PR.

Reviewed By: akankshamahajan15

Differential Revision: D34145825

Pulled By: ltamasi

fbshipit-source-id: 4e87c948407dee489d669a3e41f59e2fcc1228d8
main
Levi Tamasi 3 years ago committed by Facebook GitHub Bot
parent c5cd31c12b
commit b2423f8dde
  1. 2
      db/version_set.cc

@ -2982,7 +2982,7 @@ void VersionStorageInfo::ComputeFilesMarkedForForcedBlobGC(
uint64_t sum_total_blob_bytes = oldest_meta->GetTotalBlobBytes();
uint64_t sum_garbage_blob_bytes = oldest_meta->GetGarbageBlobBytes();
while (true) {
while (count < blob_files_.size()) {
const auto& meta = blob_files_[count];
assert(meta);

Loading…
Cancel
Save