From 20a5ff60ef7d81141687798ca9ac16c266689e6a Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Fri, 21 Feb 2025 14:41:34 +0000 Subject: [PATCH] Fix stupid error in allocating 0x20-flip bitmaps. Signed-off-by: DL6ER --- src/dnsmasq/forward.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dnsmasq/forward.c b/src/dnsmasq/forward.c index f4d66b27c..c30314f28 100644 --- a/src/dnsmasq/forward.c +++ b/src/dnsmasq/forward.c @@ -301,8 +301,9 @@ static void forward_query(int udpfd, union mysockaddr *udpaddr, if (gobig && !bitvector) { - casediff = (i/BITS_IN_INT) + 1; /* length of array */ - if ((bitvector = whine_malloc(casediff))) + casediff = ((i - 1)/BITS_IN_INT) + 1; /* length of array */ + /* whine_malloc() zeros memory */ + if ((bitvector = whine_malloc(casediff * sizeof(unsigned int)))) goto big_redo; } }