1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-31 07:51:21 +03:00

resolved: properly check return value of dns_resource_record_equal()

This commit is contained in:
Lennart Poettering 2014-08-06 16:14:53 +02:00
parent 15aa9b201c
commit 3ef77d0476
3 changed files with 4 additions and 2 deletions

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;

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;

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;