From 9d9bd3ace26e1b729b47f0381909a4fdcdab42a2 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Mon, 8 Aug 2022 11:42:07 -0700 Subject: [PATCH] fix overflow error in mem_putstats() an integer overflow could cause an assertion failure when freeing memory. --- CHANGES | 3 +++ lib/isc/mem.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 5072e6d28b..d9920c89b5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +5938. [bug] An integer type overflow could cause an assertion + failure when freeing memory. [GL #3483] + 5937. [cleanup] The dns_rdatalist_tordataset() and dns_rdatalist_fromrdataset() functions can no longer fail. Clean up their prototypes and error diff --git a/lib/isc/mem.c b/lib/isc/mem.c index bebe0e5c6c..b2e53a31e1 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -414,7 +414,7 @@ mem_getstats(isc_mem_t *ctx, size_t size) { static void mem_putstats(isc_mem_t *ctx, void *ptr, size_t size) { struct stats *stats = stats_bucket(ctx, size); - uint_fast32_t s, g; + atomic_size_t s, g; UNUSED(ptr);