diff options
Diffstat (limited to 'contrib/librdns/packet.c')
-rw-r--r-- | contrib/librdns/packet.c | 4 |
1 files 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) { |