resolved: properly check return value of dns_resource_record_equal()

This commit is contained in:
Lennart Poettering
2014-08-11 15:06:22 +02:00
parent 15aa9b201c
commit 3ef77d0476
3 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -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;
+2
View File
@@ -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;
+1 -1
View File
@@ -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;