]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
ensure clientstr is null-terminated
authorEvan Hunt <each@isc.org>
Sat, 6 Jun 2020 01:55:22 +0000 (18:55 -0700)
committerEvan Hunt <each@isc.org>
Sat, 6 Jun 2020 01:56:40 +0000 (18:56 -0700)
lib/dns/resolver.c

index a6d0a65eabed3c4c2b2de00acf469a231324b8d6..5a1f0c9f06a3592598620949fabf66d4e44f19fb 100644 (file)
@@ -4996,7 +4996,7 @@ fctx_create(dns_resolver_t *res, const dns_name_t *name, dns_rdatatype_t type,
                isc_sockaddr_format(client, fctx->clientstr,
                                    sizeof(fctx->clientstr));
        } else {
-               memmove(fctx->clientstr, "<unknown>", sizeof("<unknown"));
+               strlcpy(fctx->clientstr, "<unknown>", sizeof(fctx->clientstr));
        }
        fctx->ns_ttl = 0;
        fctx->ns_ttl_ok = false;