]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix segfault in auth-zone read and reorder of RRSIGs.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 15 Aug 2018 09:26:13 +0000 (09:26 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 15 Aug 2018 09:26:13 +0000 (09:26 +0000)
git-svn-id: file:///svn/unbound/trunk@4853 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/authzone.c
testcode/unitauth.c

index 60458c6125b2ec2d3af0d4053d6e552ecb17e3be..1be8ddf950151a375ab991b46dd6c89ea3e654bc 100644 (file)
@@ -1,3 +1,6 @@
+15 August 2018: Wouter
+       - Fix segfault in auth-zone read and reorder of RRSIGs.
+
 14 August 2018: Wouter
        - Fix that printout of error for cycle targets is a verbosity 4
          printout and does not wrongly print it is a memory error.
index b9576eaae73a97d7a9b6d867d46ea2c93a263cbe..e8c99077d492d7bf2c8ecaef819d0bd08bfa37a3 100644 (file)
@@ -1014,7 +1014,8 @@ rrset_moveover_rrsigs(struct auth_data* node, uint16_t rr_type,
        }
        /* copy base values */
        memcpy(sigd, sigold, sizeof(struct packed_rrset_data));
-       sigd->rrsig_count -= sigs;
+       /* in sigd the RRSIGs are stored in the base of the RR, in count */
+       sigd->count -= sigs;
        /* setup rr_len */
        sigd->rr_len = (size_t*)((uint8_t*)sigd +
                sizeof(struct packed_rrset_data));
index 4b538ef626872e5d99b32cd1869978f7dc879920..19d3c4f67bb45cb2838ecdb995cadccaca560aa2 100644 (file)
@@ -131,6 +131,12 @@ static const char* zone_example_com =
 "z9.example.com.       3600    IN      A       10.0.0.10\n"
 "z9.example.com.       3600    IN      RRSIG   A 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk=\n"
 "z9.example.com.       3600    IN      RRSIG   A 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk=\n"
+/* different covered types, first RRSIGs then, RRs, then another RRSIG */
+"z10.example.com.      3600    IN      RRSIG   AAAA 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk=\n"
+"z10.example.com.      3600    IN      RRSIG   A 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk=\n"
+"z10.example.com.      3600    IN      A       10.0.0.10\n"
+"z10.example.com.      3600    IN      RRSIG   CNAME 8 3 10200 20170612005010 20170515005010 42393 nlnetlabs.nl. NhEDrHkuIgHkjWhDRVsGOIJWZpSs+QdduilWFe5d+/ZhOheLJbaTYD5w6+ZZ3yPh1tNud+jlg+GyiOSVapLEO31swDCIarL1UfRjRSpxxDCHGag5Zu+S4hF+KURxO3cJk8jLBELMQyRuMRHoKrw/wsiLGVu1YpAyAPPMcjFBNbk=\n"
+"z10.example.com.      3600    IN      AAAA    ::11\n"
 #endif /* if0 for duplicates and reordering */
 ;
 
@@ -554,7 +560,7 @@ checkfile(char* f1, char *f2)
                        log_info("in files %s and %s:%d", f1, f2, line);
                        log_info("'%s'", buf1);
                        log_info("'%s'", buf2);
-                       fatal_exit("files are not eqaul");
+                       fatal_exit("files are not equal");
                }
        }
        unit_assert(feof(i1) && feof(i2));