From b9cba520417ae7b01bbd59b16a4b180eab3338ae Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Thu, 13 Jun 2019 13:36:45 +0300 Subject: [PATCH] memorypool: removed redundant check, which also fails in case shrinking --- src/microhttpd/memorypool.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c index c7541cda..12a22f22 100644 --- a/src/microhttpd/memorypool.c +++ b/src/microhttpd/memorypool.c @@ -277,8 +277,7 @@ MHD_pool_reallocate (struct MemoryPool *pool, if (pool->pos == ROUND_TO_ALIGN (old_offset + old_size)) { /* "old" block is the last allocated block */ const size_t new_apos = ROUND_TO_ALIGN (old_offset + new_size); - if ( (new_apos > pool->end) || - (new_apos < pool->pos) ) /* Value wrap */ + if (new_apos > pool->end) return NULL; /* No space */ pool->pos = new_apos;