libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 5abfcc927a10db131aaa47ca6ccbe0cbc828cbe5
parent 97b4296cc09be5216e7cf1b3dce33684864bf75e
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Wed,  8 Jul 2026 11:56:37 +0200

add assertion to prevent underflow

Diffstat:
Msrc/microhttpd/memorypool.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/microhttpd/memorypool.c b/src/microhttpd/memorypool.c @@ -734,6 +734,7 @@ MHD_pool_reset (struct MemoryPool *pool, mhd_assert (pool->end >= pool->pos); mhd_assert (pool->size >= pool->end - pool->pos); mhd_assert (copy_bytes <= new_size); + mhd_assert (new_size <= pool->size); mhd_assert (copy_bytes <= pool->size); mhd_assert (keep != NULL || copy_bytes == 0); mhd_assert (keep == NULL || mp_ptr_le_ (pool->memory, keep));