From 2b1c8500fcf510083a4cb7572cd99ad51bcff97b Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 12 Jun 2024 01:14:49 +0200 Subject: Assert that we aren’t freeing anything MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/alloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/alloc.c b/src/alloc.c index 35b45c0..8682656 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -8,6 +9,7 @@ void * bufalloc(void *ptr, size_t nmemb, size_t size) { + assert(nmemb * size != 0); if (size > SIZE_MAX / nmemb) { errno = EOVERFLOW; err("%s:", __func__); -- cgit v1.2.3