commit 9665bdd0a83f2a8792a4bd324dea927940b3b236
parent d4b9fc7ee15bad4cee47c91e5ecd2c05b069a70a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Wed, 7 Oct 2020 15:47:36 +0300
memorypool: fixed assert for an edge situation
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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 */