aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-20 16:15:19 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-01-20 16:15:19 +0000
commitef66ecf2243d5b975afd2448cd4c01583e04b2bf (patch)
tree9d867f91efe8827e77a8bcda6a189b0f0b21be1c /contrib
parentdfe3d5560b54f60c83512ba3c3f1278a43540e38 (diff)
downloadrspamd-ef66ecf2243d5b975afd2448cd4c01583e04b2bf.tar.gz
rspamd-ef66ecf2243d5b975afd2448cd4c01583e04b2bf.zip
Fix memory corruption on punycode
Diffstat (limited to 'contrib')
-rw-r--r--contrib/librdns/packet.c3
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;