From 747fd5c12132cb95fc0750c0cc9cb48d782510d3 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 30 May 2026 02:27:39 +0300 Subject: [PATCH] Add count >= maxn assert --- src/blockstore/multilist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blockstore/multilist.cpp b/src/blockstore/multilist.cpp index 6b9f5f42..df831e36 100644 --- a/src/blockstore/multilist.cpp +++ b/src/blockstore/multilist.cpp @@ -12,7 +12,7 @@ multilist_alloc_t::multilist_alloc_t(uint32_t count, uint32_t maxn): count(count), maxn(maxn) { // not-so-memory-efficient: 16 MB memory per 1 GB buffer space, but buffer spaces are small, so OK - assert(count > 1 && count < 0x80000000); + assert(count > 1 && count < 0x80000000 && count >= maxn); sizes.resize(count); nexts.resize(count); // nexts[i] = 0 -> area is used; nexts[i] = 1 -> no next; nexts[i] >= 2 -> next item prevs.resize(count);