From c9e47e9bfdf0989f8981190031cad05efc0ce1b0 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Mon, 22 Mar 2021 09:51:39 +0100 Subject: [PATCH] Fixes for IPv6 parsing with SVCB --- str2host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 (;;) { -- 2.47.3