Security: resolved: bugfix of null pointer p->question dereferencing (#6020)
authorsanghyeok.oh <sanghyeok.oh@samsung.com>
Mon, 12 Jun 2017 02:34:22 +0000 (11:34 +0900)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Mon, 12 Feb 2024 15:37:43 +0000 (16:37 +0100)
commit a924f43f30f9c4acaf70618dd2a055f8b0f166be
Refs: v233-511-ga924f43
Author:     Evgeny Vereshchagin <evvers@ya.ru>
AuthorDate: Wed May 24 08:56:48 2017 +0300
Commit:     GitHub <noreply@github.com>
CommitDate: Wed May 24 08:56:48 2017 +0300

    resolved: bugfix of null pointer p->question dereferencing (#6020)

    See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1621396

Change-Id: I49d03500576c24b4b382accf1dcde8e1d4a5060e
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
src/resolve/resolved-dns-packet.c

index a8ad8fe..8b620cb 100644 (file)
@@ -2264,6 +2264,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;