Skip to content

Commit

Permalink
Add bounds check in FilePickerMultiGet::PrepareNextLevel() (#5189)
Browse files Browse the repository at this point in the history
Summary:
Add bounds check when looping through empty levels in FilePickerMultiGet
Pull Request resolved: #5189

Differential Revision: D14925334

Pulled By: anand1976

fbshipit-source-id: 65d53247cf443153e28ce2b8b753fa51c6ae4566
  • Loading branch information
anand76 authored and facebook-github-bot committed Apr 13, 2019
1 parent cca141e commit 29111e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions db/version_set.cc
Expand Up @@ -672,8 +672,11 @@ class FilePickerMultiGet {
fp_ctx.search_right_bound = FileIndexer::kLevelMaxIndex;
}
// Skip all subsequent empty levels
while ((*level_files_brief_)[++curr_level_].num_files == 0) {
}
do {
++curr_level_;
} while ((curr_level_ < num_levels_) &&
(*level_files_brief_)[curr_level_].num_files == 0);
continue;
}

// Some files may overlap each other. We find
Expand Down

0 comments on commit 29111e9

Please sign in to comment.