1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-13 23:21:08 +03:00

resolved: packet - fix segfault in truncate()

A size_t was being accessed as a char* due to the order of arguments being inverted.
This commit is contained in:
Tom Gundersen 2015-07-17 23:42:18 +02:00
parent 8e6edc490c
commit 0e03ade57e

View File

@ -275,7 +275,7 @@ static void dns_packet_truncate(DnsPacket *p, size_t sz) {
if (p->size <= sz) if (p->size <= sz)
return; return;
HASHMAP_FOREACH_KEY(s, n, p->names, i) { HASHMAP_FOREACH_KEY(n, s, p->names, i) {
if (PTR_TO_SIZE(n) < sz) if (PTR_TO_SIZE(n) < sz)
continue; continue;