From: Wouter Wijngaards Date: Mon, 2 Nov 2009 11:30:42 +0000 (+0000) Subject: Fixed segfault when verify-zone reads unparseable zone file. X-Git-Tag: release-1.6.2~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbdccca80f255e0b70301abd93be7d733a759ec1;p=thirdparty%2Fldns.git Fixed segfault when verify-zone reads unparseable zone file. --- diff --git a/examples/ldns-verify-zone.c b/examples/ldns-verify-zone.c index 397f81ee..2c86737f 100644 --- a/examples/ldns-verify-zone.c +++ b/examples/ldns-verify-zone.c @@ -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) {