diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-20 16:15:19 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-20 16:15:19 +0000 |
commit | ef66ecf2243d5b975afd2448cd4c01583e04b2bf (patch) | |
tree | 9d867f91efe8827e77a8bcda6a189b0f0b21be1c /contrib | |
parent | dfe3d5560b54f60c83512ba3c3f1278a43540e38 (diff) | |
download | rspamd-ef66ecf2243d5b975afd2448cd4c01583e04b2bf.tar.gz rspamd-ef66ecf2243d5b975afd2448cd4c01583e04b2bf.zip |
Fix memory corruption on punycode
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/librdns/packet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/contrib/librdns/packet.c b/contrib/librdns/packet.c index 630413fdb..6ce3f50fa 100644 --- a/contrib/librdns/packet.c +++ b/contrib/librdns/packet.c @@ -132,7 +132,7 @@ rdns_format_dns_name (struct rdns_resolver *resolver, const char *in, p = in; olen = inlen + 1 + sizeof ("xn--") * labels; - *out = malloc (olen); + *out = malloc (olen + 1); if (*out == NULL) { return false; @@ -222,6 +222,7 @@ rdns_format_dns_name (struct rdns_resolver *resolver, const char *in, goto err; } } + *o = '\0'; *outlen = o - *out; |