From a6770f619ae54ac2d42ce6f7292b03e70cf24834 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 26 Nov 2019 12:06:42 +0300 Subject: [PATCH] Fix crash while reading metadata --- blockstore_init.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/blockstore_init.cpp b/blockstore_init.cpp index 0220e475..7db00790 100644 --- a/blockstore_init.cpp +++ b/blockstore_init.cpp @@ -80,15 +80,14 @@ int blockstore_init_meta::loop() void blockstore_init_meta::handle_entries(struct clean_disk_entry* entries, int count, int block_order) { - auto end = bs->clean_db.end(); for (unsigned i = 0; i < count; i++) { if (entries[i].oid.inode > 0) { auto clean_it = bs->clean_db.find(entries[i].oid); - if (clean_it == end || clean_it->second.version < entries[i].version) + if (clean_it == bs->clean_db.end() || clean_it->second.version < entries[i].version) { - if (clean_it != end) + if (clean_it != bs->clean_db.end()) { // free the previous block allocator_set(bs->data_alloc, clean_it->second.version >> block_order, false);