chiark / gitweb /
resolved: don't attempt to order empty answer array
authorLennart Poettering <lennart@poettering.net>
Wed, 30 Jul 2014 17:24:05 +0000 (19:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 30 Jul 2014 17:24:13 +0000 (19:24 +0200)
src/resolve/resolved-dns-scope.c

index 5141a8d..4c53edb 100644 (file)
@@ -493,7 +493,8 @@ void dns_scope_process_query(DnsScope *s, DnsStream *stream, DnsPacket *p) {
         if (r == 0)
                 return;
 
-        dns_answer_order_by_scope(answer, in_addr_is_link_local(p->family, &p->sender) > 0);
+        if (answer)
+                dns_answer_order_by_scope(answer, in_addr_is_link_local(p->family, &p->sender) > 0);
 
         r = dns_scope_make_reply_packet(s, DNS_PACKET_ID(p), DNS_RCODE_SUCCESS, p->question, answer, soa, &reply);
         if (r < 0) {