]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Fixed segfault when verify-zone reads unparseable zone file.
authorWouter Wijngaards <wouter@NLnetLabs.nl>
Mon, 2 Nov 2009 11:30:42 +0000 (11:30 +0000)
committerWouter Wijngaards <wouter@NLnetLabs.nl>
Mon, 2 Nov 2009 11:30:42 +0000 (11:30 +0000)
examples/ldns-verify-zone.c

index 397f81ee9e45fd5faa1d9c5bbbd46132ff5dde0c..2c86737f6ccb095fb5bebdef800235ff0ff4aff9 100644 (file)
@@ -659,13 +659,13 @@ main(int argc, char **argv)
 
        s = ldns_zone_new_frm_fp_l(&z, fp, NULL, 0, LDNS_RR_CLASS_IN, &line_nr);
 
-       if (!ldns_zone_soa(z)) {
-               fprintf(stderr, "; Error: no SOA in the zone\n");
-               exit(1);
-       }
-
-       glue_rrs = ldns_zone_glue_rr_list(z);
        if (s == LDNS_STATUS_OK) {
+               if (!ldns_zone_soa(z)) {
+                       fprintf(stderr, "; Error: no SOA in the zone\n");
+                       exit(1);
+               }
+
+               glue_rrs = ldns_zone_glue_rr_list(z);
                dnssec_zone = create_dnssec_zone(z);
 
                if (verbosity >= 5) {