~mdw
/
adns
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fix for malicious optimisation of memcpy in test suite, which causes failure with...
[adns]
/
regress
/
hcommon.c.m4
diff --git
a/regress/hcommon.c.m4
b/regress/hcommon.c.m4
index
c5069ee
..
330da4d
100644
(file)
--- a/
regress/hcommon.c.m4
+++ b/
regress/hcommon.c.m4
@@
-301,7
+301,7
@@
void *Hrealloc(void *op, size_t nsz) {
if (op) { oldnode= (void*)((char*)op - MALLOCHSZ); osz= oldnode->sz; } else { osz= 0; }
np= Hmalloc(nsz);
- memcpy(np,op, osz>nsz ? nsz : osz);
+
if (osz)
memcpy(np,op, osz>nsz ? nsz : osz);
Hfree(op);
return np;
}