From 9ac81649d3523ee0c21005029f3f6173473e69d7 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 20 Jan 2016 16:24:22 +0000 Subject: [PATCH] Another fix to punycode --- contrib/librdns/packet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.39.5