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:
parent
15aa9b201c
commit
3ef77d0476
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user