]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
Final code reviews
authorWillem Toorop <willem@NLnetLabs.nl>
Fri, 18 May 2012 15:09:22 +0000 (15:09 +0000)
committerWillem Toorop <willem@NLnetLabs.nl>
Fri, 18 May 2012 15:09:22 +0000 (15:09 +0000)
- Potential uninitialized variable usage in dnssec.c
- Freeing of temporarily allocated ldns_zone in ldns_dnssec_zone_new_frm_fp_l
- Clarify defaults for -i and -e options to ldns-verify-zone

dnssec_zone.c
drill/dnssec.c
examples/ldns-verify-zone.1
examples/ldns-verify-zone.c

index 385ba2b9fa0e3eea5034c0dfd2a92c77e17089a4..1f7274bbc9692234b58fcea8fc159628bdaa3d3d 100644 (file)
@@ -634,7 +634,7 @@ rr_is_rrsig_covering(ldns_rr* rr, ldns_rr_type t)
  * function) uses the rbtree mostly for sequentual walking, this results
  * in a speed increase (of 15% on linux) because we have less CPU-cache misses.
  */
-#define FASTER_DNSSEC_ZONE_NEW_FRM_FP 1
+#define FASTER_DNSSEC_ZONE_NEW_FRM_FP 1 /* Because of L2 cache efficiency */
 
 ldns_status
 ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin,
@@ -657,7 +657,7 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin,
        ldns_status status = LDNS_STATUS_MEM_ERR;
 
 #ifdef FASTER_DNSSEC_ZONE_NEW_FRM_FP
-       ldns_zone* zone;
+       ldns_zone* zone = NULL;
        if (ldns_zone_new_frm_fp_l(&zone, fp, origin,ttl, c, line_nr)
                        != LDNS_STATUS_OK) goto error;
 #else
@@ -748,6 +748,11 @@ ldns_dnssec_zone_new_frm_fp_l(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin,
        return LDNS_STATUS_OK;
 
 error:
+#ifdef FASTER_DNSSEC_ZONE_NEW_FRM_FP
+       if (zone) {
+               ldns_zone_free(zone);
+       }
+#endif
        if (my_origin) {
                ldns_rdf_deep_free(my_origin);
        }
index de3ccf449be795124e85ad39fc045da9fa1c7262..b72ffb95dadc3ab68aecbb04df064d341dad7ceb 100644 (file)
@@ -353,7 +353,7 @@ ldns_nsec3_closest_encloser(ldns_rdf *qname, ldns_rr_type qtype, ldns_rr_list *n
        bool exact_match_found;
        bool in_range_found;
        
-       ldns_rdf *zone_name;
+       ldns_rdf *zone_name = NULL;
        
        size_t nsec_i;
        ldns_rr *nsec;
index cc93ce753c40524883bd55f5426d3b5bfb001d2a..a4cb767d2799554a84234ca1d7a785c85cef5aba 100644 (file)
@@ -25,10 +25,12 @@ Apex only, check only the zone apex
 .TP
 \fB-e\fR \fIperiod\fR
 Signatures may not expire within this period.
+Default no period is used.
 
 .TP
 \fB-i\fR \fIperiod\fR
 Signatures must have been valid at least this long.
+Default signatures should just be valid now.
 
 .TP
 \fB-k\fR \fIfile\fR
@@ -67,6 +69,13 @@ Set the verbosity level (default 3):
  5: Print the zone after it has been read, the result, 
     any errors, and the names that are being checked
 
+.LP
+\fIperiod\fRs are given in ISO 8601 duration format:
+.RS
+P[n]Y[n]M[n]DT[n]H[n]M[n]S
+.RE
+.LP
+If no file is given standard input is read.
 
 .SH AUTHOR
 Written by the ldns team as an example for ldns usage.
index e30907b4e6b2b0c135efae78233bfacc38a0966d..1dd9aaea8b64fc74d46a961b5362fd4d37d22bb9 100644 (file)
@@ -741,9 +741,12 @@ main(int argc, char **argv)
                        printf("\t-a\t\tapex only, "
                               "check only the zone apex\n");
                        printf("\t-e <period>\tsignatures may not expire "
-                              "within this period.\n");
+                              "within this period.\n\t\t\t"
+                              "(default no period is used)\n");
                        printf("\t-i <period>\tsignatures must have been "
-                              "valid at least this long.\n");
+                              "valid at least this long.\n\t\t\t"
+                              "(default signatures should just be valid "
+                              "now)\n");
                        printf("\t-k <file>\tspecify a file that contains a "
                               "trusted DNSKEY or DS rr.\n\t\t\t"
                               "This option may be given more than once.\n");