diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index bae5a2bd0a..a91a5d52ff 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -4983,7 +4983,6 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type, isc_interval_t interval; unsigned int findoptions = 0; char buf[DNS_NAME_FORMATSIZE + DNS_RDATATYPE_FORMATSIZE + 1]; - char typebuf[DNS_RDATATYPE_FORMATSIZE]; isc_mem_t *mctx; size_t p; bool try_stale; @@ -5012,9 +5011,9 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type, * "name/type". */ dns_name_format(name, buf, sizeof(buf)); - dns_rdatatype_format(type, typebuf, sizeof(typebuf)); p = strlcat(buf, "/", sizeof(buf)); - strlcat(buf + p, typebuf, sizeof(buf)); + INSIST(p + DNS_RDATATYPE_FORMATSIZE < sizeof(buf)); + dns_rdatatype_format(type, buf + p, sizeof(buf) - p); fctx->info = isc_mem_strdup(mctx, buf); FCTXTRACE("create");