From 0e03ade57ea327cdefc34aaeb0a47c985b238120 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Fri, 17 Jul 2015 23:42:18 +0200 Subject: [PATCH] resolved: packet - fix segfault in truncate() A size_t was being accessed as a char* due to the order of arguments being inverted. --- src/resolve/resolved-dns-packet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c index 2dd1f564fa4..649e8b74e15 100644 --- a/src/resolve/resolved-dns-packet.c +++ b/src/resolve/resolved-dns-packet.c @@ -275,7 +275,7 @@ static void dns_packet_truncate(DnsPacket *p, size_t sz) { if (p->size <= sz) return; - HASHMAP_FOREACH_KEY(s, n, p->names, i) { + HASHMAP_FOREACH_KEY(n, s, p->names, i) { if (PTR_TO_SIZE(n) < sz) continue;