diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-10-07 15:47:36 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2020-10-07 15:47:36 +0300 |
commit | 9665bdd0a83f2a8792a4bd324dea927940b3b236 (patch) | |
tree | e06b46e08b37fd14b805e92b2b066ae204c4369c | |
parent | d4b9fc7ee15bad4cee47c91e5ecd2c05b069a70a (diff) | |
download | libmicrohttpd-9665bdd0a83f2a8792a4bd324dea927940b3b236.tar.gz libmicrohttpd-9665bdd0a83f2a8792a4bd324dea927940b3b236.zip |
memorypool: fixed assert for an edge situation
-rw-r--r-- | src/microhttpd/memorypool.c | 3 |
1 files changed, 2 insertions, 1 deletions
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, | |||
324 | mhd_assert (old == NULL || pool->memory + pool->size >= (uint8_t*) old | 324 | mhd_assert (old == NULL || pool->memory + pool->size >= (uint8_t*) old |
325 | + old_size); | 325 | + old_size); |
326 | /* Blocks "from the end" must not be reallocated */ | 326 | /* Blocks "from the end" must not be reallocated */ |
327 | mhd_assert (old == NULL || pool->memory + pool->pos > (uint8_t*) old); | 327 | mhd_assert (old == NULL || old_size == 0 || \ |
328 | pool->memory + pool->pos > (uint8_t*) old); | ||
328 | 329 | ||
329 | if (0 != old_size) | 330 | if (0 != old_size) |
330 | { /* Need to save some data */ | 331 | { /* Need to save some data */ |