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

See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1621396
This commit is contained in:
Evgeny Vereshchagin 2017-05-24 08:56:48 +03:00 committed by GitHub
parent d82c4b9a7b
commit a924f43f30
1 changed files with 3 additions and 0 deletions

View 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;