summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/resolve/resolved-dns-cache.c2
-rw-r--r--src/resolve/resolved-dns-packet.c2
-rw-r--r--src/resolve/resolved-dns-zone.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-cache.c b/src/resolve/resolved-dns-cache.c
index 40fb6c3984..696eb9d523 100644
--- a/src/resolve/resolved-dns-cache.c
+++ b/src/resolve/resolved-dns-cache.c
@@ -224,7 +224,7 @@ static DnsCacheItem* dns_cache_get(DnsCache *c, DnsResourceRecord *rr) {
assert(rr);
LIST_FOREACH(by_key, i, hashmap_get(c->by_key, rr->key))
- if (i->rr && dns_resource_record_equal(i->rr, rr))
+ if (i->rr && dns_resource_record_equal(i->rr, rr) > 0)
return i;
return NULL;
diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c
index b97fd17963..4f9503803b 100644
--- a/src/resolve/resolved-dns-packet.c
+++ b/src/resolve/resolved-dns-packet.c
@@ -1029,6 +1029,8 @@ static bool loc_size_ok(uint8_t size) {
}
static int dnskey_parse_flags(DnsResourceRecord *rr, uint16_t flags) {
+ assert(rr);
+
if (flags & ~(DNSKEY_FLAG_SEP | DNSKEY_FLAG_ZONE_KEY))
return -EBADMSG;
diff --git a/src/resolve/resolved-dns-zone.c b/src/resolve/resolved-dns-zone.c
index 72321d0c6b..ed47759106 100644
--- a/src/resolve/resolved-dns-zone.c
+++ b/src/resolve/resolved-dns-zone.c
@@ -104,7 +104,7 @@ static DnsZoneItem* dns_zone_get(DnsZone *z, DnsResourceRecord *rr) {
assert(rr);
LIST_FOREACH(by_key, i, hashmap_get(z->by_key, rr->key))
- if (dns_resource_record_equal(i->rr, rr))
+ if (dns_resource_record_equal(i->rr, rr) > 0)
return i;
return NULL;