summaryrefslogtreecommitdiff
path: root/rr.c
diff options
context:
space:
mode:
authorWouter Wijngaards <wouter@NLnetLabs.nl>2009-12-09 10:04:34 +0100
committerWouter Wijngaards <wouter@NLnetLabs.nl>2009-12-09 10:04:34 +0100
commit277cbb24dd7606979ef6987dbcf7ed3a0c4652c9 (patch)
tree16a220824f69aaba26a8d3fe54caac5a242272f1 /rr.c
parentbd8160fe121b36d866ec64ba04078a94a78e1632 (diff)
downloadldns-277cbb24dd7606979ef6987dbcf7ed3a0c4652c9.tar.gz
Fixup bug reported for unbound (bug#287).
Diffstat (limited to 'rr.c')
-rw-r--r--rr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rr.c b/rr.c
index f397249c..a8aad566 100644
--- a/rr.c
+++ b/rr.c
@@ -477,7 +477,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
rd);
/* check if the origin should be used or concatenated */
- if (ldns_rdf_size(r) > 1 && ldns_rdf_data(r)[0] == 1
+ if (r && ldns_rdf_size(r) > 1 && ldns_rdf_data(r)[0] == 1
&& ldns_rdf_data(r)[1] == '@') {
ldns_rdf_deep_free(r);
if (origin) {
@@ -490,7 +490,7 @@ ldns_rr_new_frm_str_internal(ldns_rr **newrr, const char *str,
r = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, ".");
}
}
- } else if (rd_strlen >= 1 && !ldns_dname_str_absolute(rd) && origin) {
+ } else if (r && rd_strlen >= 1 && !ldns_dname_str_absolute(rd) && origin) {
if (ldns_dname_cat(r, origin) != LDNS_STATUS_OK) {
return LDNS_STATUS_ERR;
}