]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_9] zone parsing broken with embedded null
authorEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 02:58:53 +0000 (19:58 -0700)
committerEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 02:58:53 +0000 (19:58 -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 686998bf4f20fed76d85beaac722d533a2aafc54..aac50b908568ca0cdcfdfdfb820b0055543f6008 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 b50722b7a2482b4474aa9410c63a6a89ffb6c597..168e754d80065fd5032d239383b0e7b3e8697067 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 ff1c2abbe9cb815513ad59e5bf10b78f54b79ac8..d0c175876f5cb7d61388188606c49cb1cbdeb82b 100644 (file)
@@ -570,6 +570,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;