mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-28 21:08:35 +00:00
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 <dl6er@dl6er.de>
This commit is contained in:
1 parent
b95d5a2577
commit
5ea054b264
1 file changed
+1
-1
+1
-1
@@ -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 *))))
|
if (!(p = whine_realloc_real("expand_workspace", func, line, *wkspc, new * sizeof(unsigned char *))))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
memset(p+old, 0, new-old);
|
memset(p+old, 0, (new-old) * sizeof(unsigned char *));
|
||||||
|
|
||||||
*wkspc = p;
|
*wkspc = p;
|
||||||
*szp = new;
|
*szp = new;
|
||||||
|
|||||||
Reference in new issue
Block a user