summaryrefslogtreecommitdiff
path: root/rr.c
diff options
context:
space:
mode:
authorWillem Toorop <willem@NLnetLabs.nl>2011-08-29 16:02:00 +0200
committerWillem Toorop <willem@NLnetLabs.nl>2011-08-29 16:02:00 +0200
commit572cbc7a645bef35ea5013d918d41ef28e5efb0f (patch)
treee9d39996834854647ec5f8b6784e1656affa556b /rr.c
parent513eedad0a3ed4051ed96b644de0c897bc3d5d51 (diff)
downloadldns-572cbc7a645bef35ea5013d918d41ef28e5efb0f.tar.gz
Assertion error fix! Bug #391
Diffstat (limited to 'rr.c')
-rw-r--r--rr.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/rr.c b/rr.c
index bfdcf0ba..3e24cbde 100644
--- a/rr.c
+++ b/rr.c
@@ -838,7 +838,7 @@ ldns_rr_pop_rdf(ldns_rr *rr)
ldns_rdf *
ldns_rr_rdf(const ldns_rr *rr, size_t nr)
{
- if (nr < ldns_rr_rd_count(rr)) {
+ if (rr && nr < ldns_rr_rd_count(rr)) {
return rr->_rdata_fields[nr];
} else {
return NULL;
@@ -1638,7 +1638,10 @@ ldns_rr_compare_ds_dnskey(ldns_rr *ds,
return false;
}
-algo = ldns_rdf2native_int8(ldns_rr_rdf(ds, 2));
+ if (ldns_rr_rdf(ds, 2) == NULL) {
+ return false;
+ }
+ algo = ldns_rdf2native_int8(ldns_rr_rdf(ds, 2));
ds_gen = ldns_key_rr2ds(dnskey, algo);
if (ds_gen) {