From 9665bdd0a83f2a8792a4bd324dea927940b3b236 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Wed, 7 Oct 2020 15:47:36 +0300 Subject: memorypool: fixed assert for an edge situation --- src/microhttpd/memorypool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c index a979c64a..27f7f5ab 100644 --- a/src/microhttpd/memorypool.c +++ b/src/microhttpd/memorypool.c @@ -324,7 +324,8 @@ MHD_pool_reallocate (struct MemoryPool *pool, mhd_assert (old == NULL || pool->memory + pool->size >= (uint8_t*) old + old_size); /* Blocks "from the end" must not be reallocated */ - mhd_assert (old == NULL || pool->memory + pool->pos > (uint8_t*) old); + mhd_assert (old == NULL || old_size == 0 || \ + pool->memory + pool->pos > (uint8_t*) old); if (0 != old_size) { /* Need to save some data */ -- cgit v1.2.3