From 5ea054b2645bb435c9dbbd9c1580201b8164e459 Mon Sep 17 00:00:00 2001 From: Dominik Date: Thu, 19 Mar 2026 20:59:11 +0100 Subject: [PATCH] fix: zero correct byte count in expand_workspace_real() memset(p+old, 0, new-old) was missing the sizeof(unsigned char *) multiplier. p is unsigned char**, so each slot is pointer-sized (8 instead of 1 byte on 64-bit), yet only new-old bytes were zeroed, leaving newly allocated DNSSEC workspace pointer slots with garbage values. Signed-off-by: Dominik --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 2712549..9b8b811 100644 --- a/src/util.c +++ b/src/util.c @@ -991,7 +991,7 @@ int expand_workspace_real(const char *func, unsigned int line, unsigned char *** if (!(p = whine_realloc_real("expand_workspace", func, line, *wkspc, new * sizeof(unsigned char *)))) return 0; - memset(p+old, 0, new-old); + memset(p+old, 0, (new-old) * sizeof(unsigned char *)); *wkspc = p; *szp = new;