From: Willem Toorop Date: Mon, 22 Mar 2021 08:51:39 +0000 (+0100) Subject: Fixes for IPv6 parsing with SVCB X-Git-Tag: 1.8.0-rc.1~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9e47e9bfdf0989f8981190031cad05efc0ce1b0;p=thirdparty%2Fldns.git Fixes for IPv6 parsing with SVCB --- diff --git a/str2host.c b/str2host.c index 09a51aa2..77089b04 100644 --- a/str2host.c +++ b/str2host.c @@ -2132,7 +2132,7 @@ parse_svcparam_ipv6hint(const char **s, uint8_t **dp, uint8_t *eod) } for (;;) { const char *ipv6_start = *s; - char ipv6_str[40]; + char ipv6_str[INET6_ADDRSTRLEN]; size_t len; while (isxdigit(**s) || **s == ':') @@ -2323,9 +2323,9 @@ ldns_str2rdf_svcparams(ldns_rdf **rd, const char *str) length = strlen(str); /* Worst case space requirement. We'll realloc to actual size later. */ - if (!(dp = data = LDNS_XMALLOC(uint8_t, length))) + if (!(dp = data = LDNS_XMALLOC(uint8_t, length * 4))) return LDNS_STATUS_MEM_ERR; - eod = data + length; + eod = data + length * 4; /* Fill data with parsed bytes */ for (;;) {