mirror of
https://github.com/systemd/systemd
synced 2024-10-06 16:21:34 +00:00
resolve: fix heap-buffer-overflow reported by ASAN with strict_string_checks=1
Fixes #23942.
This commit is contained in:
parent
4707ffa8a3
commit
beeab352de
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue