From: Vsevolod Stakhov Date: Wed, 20 Jan 2016 16:24:22 +0000 (+0000) Subject: Another fix to punycode X-Git-Tag: 1.1.1~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9ac81649d3523ee0c21005029f3f6173473e69d7;p=rspamd.git Another fix to punycode --- diff --git a/contrib/librdns/packet.c b/contrib/librdns/packet.c index 6ce3f50fa..c07418604 100644 --- a/contrib/librdns/packet.c +++ b/contrib/librdns/packet.c @@ -129,9 +129,9 @@ rdns_format_dns_name (struct rdns_resolver *resolver, const char *in, } /* We need to encode */ - p = in; - olen = inlen + 1 + sizeof ("xn--") * labels; + /* We allocate 4 times more memory as we cannot guarantee encoding bounds */ + olen = inlen * sizeof (guint32) + 1 + sizeof ("xn--") * labels; *out = malloc (olen + 1); if (*out == NULL) {