]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_8] zone parsing broken with embedded null
authorEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 02:59:04 +0000 (19:59 -0700)
committerEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 02:59:04 +0000 (19:59 -0700)
3534. [bug] Extra text after an embedded NULL was ignored when
parsing zone files. [RT #32699]
(cherry picked from commit 4bf686cf5d6b83981abdf2d8157c829922acc6d4)

CHANGES
bin/tests/system/checkzone/tests.sh
bin/tests/system/checkzone/zones/bad1.db [new file with mode: 0644]
lib/dns/master.c

diff --git a/CHANGES b/CHANGES
index 9f9ee6fe9f65cb2cffef090c1199bc0812c0286c..bb648244ecdd339966645fbc267b3b8035473d40 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3534.  [bug]           Extra text after an embedded NULL was ignored when
+                       parsing zone files. [RT #32699]
+
 3533.  [contrib]       query-loc-0.4.0: memory leaks. [RT #32960]
 
 3532.  [contrib]       zkt: fixed buffer overrun, resource leaks. [RT #32960]
index 47ef756b14a8a535e7704af00cd7e5168f74b8bc..e7643cba3bcd58c1ac8729caac382f95194b5dba 100644 (file)
@@ -30,4 +30,14 @@ do
        status=`expr $status + $ret`
 done
 
+for db in zones/bad*.db
+do
+       echo "I:checking $db ($n)"
+       ret=0
+       $CHECKZONE -i local example $db > test.out.$n 2>&1 && ret=1
+       n=`expr $n + 1`
+       if [ $ret != 0 ]; then echo "I:failed"; fi
+       status=`expr $status + $ret`
+done
+
 exit $status
diff --git a/bin/tests/system/checkzone/zones/bad1.db b/bin/tests/system/checkzone/zones/bad1.db
new file mode 100644 (file)
index 0000000..b9f3ecb
Binary files /dev/null and b/bin/tests/system/checkzone/zones/bad1.db differ
index dcd59be89d0c5d56812e12ce7e3fa130663408f5..1b7460c45673cf4698d039f15b29f7415f56c478 100644 (file)
@@ -569,6 +569,7 @@ loadctx_create(dns_masterformat_t format, isc_mem_t *mctx,
                        goto cleanup_inc;
                lctx->keep_lex = ISC_FALSE;
                memset(specials, 0, sizeof(specials));
+               specials[0] = 1;
                specials['('] = 1;
                specials[')'] = 1;
                specials['"'] = 1;