Skip to content

Commit

Permalink
Fix stupid error in allocating 0x20-flip bitmaps.
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
simonkelley authored and DL6ER committed Feb 21, 2025
1 parent 54fcb6e commit 20a5ff6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dnsmasq/forward.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 20a5ff6

Please sign in to comment.