]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
NSEC3: reject records with a zero length hash field
authorMark Andrews <marka@isc.org>
Thu, 13 Aug 2020 02:46:55 +0000 (12:46 +1000)
committerMark Andrews <marka@isc.org>
Thu, 13 Aug 2020 14:23:47 +0000 (00:23 +1000)
(cherry picked from commit 031ee9e2791bfe02a289b41bf5f35b3ee0534a27)

lib/dns/rdata/generic/nsec3_50.c

index f97388c7f8ac3267ab841990fd7442803affde24..2767f02498f80cbe955c78b0e3e6f33e524cc8f7 100644 (file)
@@ -203,8 +203,9 @@ fromwire_nsec3(ARGS_FROMWIRE) {
        hashlen = sr.base[0];
        isc_region_consume(&sr, 1);
 
-       if (sr.length < hashlen)
+       if (hashlen < 1 || sr.length < hashlen) {
                RETERR(DNS_R_FORMERR);
+       }
        isc_region_consume(&sr, hashlen);
 
        RETERR(typemap_test(&sr, true));