]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3547. [bug] Some malformed unknown rdata records were not properly
authorMark Andrews <marka@isc.org>
Sun, 7 Apr 2013 23:55:14 +0000 (09:55 +1000)
committerMark Andrews <marka@isc.org>
Sun, 7 Apr 2013 23:55:14 +0000 (09:55 +1000)
                        detected and rejected. [RT #33129]

CHANGES
bin/tests/system/unknown/clean.sh
bin/tests/system/unknown/tests.sh
bin/tests/system/unknown/zones/nan.bad [new file with mode: 0644]
lib/dns/rdata.c

diff --git a/CHANGES b/CHANGES
index 4533469ce166288d0bc527835f55ab02a151ef4f..a25b896a8cbc2b287176a8e8d892c280324aab87 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3547.  [bug]           Some malformed unknown rdata records were not properly
+                       detected and rejected. [RT #33129]
+
 3546.  [func]          Add EUI48 and EUI64 types. [RT #33082]
 
 3545.  [bug]           RRL slip behavior was incorrect when set to 1.
index 22be4cbc49bc5ba3a26c12c5108862b940b2625a..a4c54943a6b50e73826537e83b127b7e9fab3a1a 100644 (file)
@@ -17,7 +17,7 @@
 
 # $Id: clean.sh,v 1.7 2007/09/26 03:22:44 marka Exp $
 
-rm -f dig.out
+rm -f dig.out check.out
 rm -f */named.memstats
 rm -f */*.bk
 rm -f */*.bk.*
index 69d78715218cba79a8ac9847e5a2b73a9ce740b6..aeb1a3dd088a39ed71557c3a5004dce463a6a1a3 100644 (file)
@@ -179,12 +179,21 @@ echo '"#" "2" "0145"' | diff - dig.out || ret=1
 [ $ret = 0 ] || echo "I: failed"
 status=`expr $status + $ret`
 
-echo "I:check that '"'TXT \# text'"' is not treated as the unknown escape sequence"
+echo "I:check that 'TXT \# text' is not treated as the unknown escape sequence"
 ret=0
 $DIG $DIGOPTS @10.53.0.1 +tcp +short txt9.example txt > dig.out
 echo '"#" "text"' | diff - dig.out || ret=1
 [ $ret = 0 ] || echo "I: failed"
 status=`expr $status + $ret`
 
+echo "I:check that 'TYPE353 \# cat' produces 'not a valid number'"
+ret=0
+$CHECKZONE nan.bad zones/nan.bad > check.out 2>&1
+grep "not a valid number" check.out > /dev/null || ret=1
+[ $ret = 0 ] || echo "I: failed"
+status=`expr $status + $ret`
+
+
+
 echo "I:exit status: $status"
 exit $status
diff --git a/bin/tests/system/unknown/zones/nan.bad b/bin/tests/system/unknown/zones/nan.bad
new file mode 100644 (file)
index 0000000..d8578b3
--- /dev/null
@@ -0,0 +1 @@
+@ 0 IN TYPE353 \# cat 010101010101010101
index 14df7193a87c71927db67b09ded20c9e876448ac..2bed9611c413b38429b89bcb7fc383bbf289ab6c 100644 (file)
@@ -633,9 +633,9 @@ unknown_fromtext(dns_rdataclass_t rdclass, dns_rdatatype_t type,
        if (type == 0 || dns_rdatatype_ismeta(type))
                return (DNS_R_METATYPE);
 
-       result = isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
-                                       ISC_FALSE);
-       if (result == ISC_R_SUCCESS && token.value.as_ulong > 65535U)
+       RETERR(isc_lex_getmastertoken(lexer, &token, isc_tokentype_number,
+                                       ISC_FALSE));
+       if (token.value.as_ulong > 65535U)
                return (ISC_R_RANGE);
        result = isc_buffer_allocate(mctx, &buf, token.value.as_ulong);
        if (result != ISC_R_SUCCESS)