resolved: bugfix of null pointer p->question dereferencing (#6020)
authorEvgeny Vereshchagin <evvers@ya.ru>
Wed, 24 May 2017 05:56:48 +0000 (08:56 +0300)
committerGitHub <noreply@github.com>
Wed, 24 May 2017 05:56:48 +0000 (08:56 +0300)
See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1621396

src/resolve/resolved-dns-packet.c

index 6529702..240ee44 100644 (file)
@@ -2269,6 +2269,9 @@ int dns_packet_is_reply_for(DnsPacket *p, const DnsResourceKey *key) {
         if (r < 0)
                 return r;
 
+        if (!p->question)
+                return 0;
+
         if (p->question->n_keys != 1)
                 return 0;