add assertion to prevent underflow

This commit is contained in:
Christian Grothoff
2026-07-08 11:56:37 +02:00
parent 97b4296cc0
commit 5abfcc927a
+1
View File
@@ -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));