Commit c52fb15c authored by Ian Goldberg's avatar Ian Goldberg
Browse files

Don't call memmove with NULL args, even if the length is 0

Thanks to Paul Wouters <paul@cypherpunks.ca> for the report.
parent 4d986d0d
......@@ -100,9 +100,11 @@ static unsigned char *decode(const char *msg, size_t *lenp)
bufp += mpilen; lenp -= mpilen; \
} while(0)
#define read_raw(b, l) do { \
require_len(l); \
memmove((b), bufp, (l)); \
bufp += (l); lenp -= (l); \
if (l) { \
require_len(l); \
memmove((b), bufp, (l)); \
bufp += (l); lenp -= (l); \
} \
} while(0)
#define write_int(x) do { \
bufp[0] = ((x) >> 24) & 0xff; \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment