resolve: fix heap-buffer-overflow reported by ASAN with strict_string_checks=1

Fixes #23942.
This commit is contained in:
Yu Watanabe 2022-07-08 22:00:58 +09:00
parent 4707ffa8a3
commit beeab352de

View file

@ -1389,7 +1389,7 @@ int dns_packet_read_string(DnsPacket *p, char **ret, size_t *start) {
if (memchr(d, 0, c))
return -EBADMSG;
t = strndup(d, c);
t = memdup_suffix0(d, c);
if (!t)
return -ENOMEM;