From 220bda06671141853b365461d4d870cef1e2e05d Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 23 Oct 2020 02:17:44 +0300 Subject: [PATCH] Fix possible buffer over(under)flow when handling LIST --- blockstore_impl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockstore_impl.cpp b/blockstore_impl.cpp index 4b2b857e..a147106c 100644 --- a/blockstore_impl.cpp +++ b/blockstore_impl.cpp @@ -517,7 +517,7 @@ void blockstore_impl_t::process_list(blockstore_op_t *op) if (!replace_stable(dirty_it->first.oid, dirty_it->first.version, 0, clean_stable_count, stable)) { // Then try to replace the last dirty stable version in the second part of the list - if (stable[stable_count-1].oid == dirty_it->first.oid) + if (stable_count > 0 && stable[stable_count-1].oid == dirty_it->first.oid) { stable[stable_count-1].version = dirty_it->first.version; }