[thin_show_metadata] Fix out-of-bounds access

This commit is contained in:
Ming-Hung Tsai 2021-06-01 11:24:11 +08:00
parent f7e4a8faa9
commit 0004dced93
1 changed files with 2 additions and 1 deletions

View File

@ -206,7 +206,8 @@ namespace {
void run() {
auto line_length = 80;
for (block_address b = 0; b < 2000; b++) {
block_address nr_blocks = std::min<block_address>(2000, bm_.get_nr_blocks());
for (block_address b = 0; b < nr_blocks; b++) {
block_manager::read_ref rr = bm_.read_lock(b);
if (!(b % line_length)) {