[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4062 - trunk/OpenDNSSEC/signer/src/signer

Matthijs Mekking matthijs at nlnetlabs.nl
Wed Oct 6 14:47:19 CEST 2010


Author: matthijs
Date: 2010-10-06 14:47:19 +0200 (Wed, 06 Oct 2010)
New Revision: 4062

Modified:
   trunk/OpenDNSSEC/signer/src/signer/rrset.c
Log:
only add signatures if the new_rrsigs is not empty



Modified: trunk/OpenDNSSEC/signer/src/signer/rrset.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/signer/rrset.c	2010-10-06 11:22:55 UTC (rev 4061)
+++ trunk/OpenDNSSEC/signer/src/signer/rrset.c	2010-10-06 12:47:19 UTC (rev 4062)
@@ -726,23 +726,24 @@
         /* now add the signatures to the RRset */
         walk_rrsigs = new_rrsigs;
         while (walk_rrsigs) {
-            error = rrsigs_add_sig(rrset->rrsigs, walk_rrsigs->rr,
-                walk_rrsigs->key_locator, walk_rrsigs->key_flags);
-            if (error) {
-                se_log_error("error adding RRSIG to RRset[%i]",
-                    rrset->rr_type);
-                rrset_log_rr(walk_rrsigs->rr, "+RRSIG", 1);
-                ldns_rr_list_free(rr_list);
-                rrsigs_cleanup(new_rrsigs);
-                return 1;
+            if (walk_rrsigs->rr) {
+                error = rrsigs_add_sig(rrset->rrsigs, walk_rrsigs->rr,
+                    walk_rrsigs->key_locator, walk_rrsigs->key_flags);
+                if (error) {
+                    se_log_error("error adding RRSIG to RRset[%i]",
+                        rrset->rr_type);
+                    rrset_log_rr(walk_rrsigs->rr, "+RRSIG", 1);
+                    ldns_rr_list_free(rr_list);
+                    rrsigs_cleanup(new_rrsigs);
+                    return 1;
+                }
+                /* this RRSIG is now in the RRset, don't clean it up */
+                walk_rrsigs->rr = NULL;
+
+                rrset->rrsig_count += 1;
+                rrset_log_rr(walk_rrsigs->rr, "+RRSIG", 6);
+                newsigs++;
             }
-
-            /* this RRSIG is now in the RRset, don't clean it up */
-            walk_rrsigs->rr = NULL;
-
-            rrset->rrsig_count += 1;
-            rrset_log_rr(walk_rrsigs->rr, "+RRSIG", 6);
-            newsigs++;
             walk_rrsigs = walk_rrsigs->next;
         }
 




More information about the Opendnssec-commits mailing list