]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_6] zone parsing broken with embedded null
authorEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 02:59:14 +0000 (19:59 -0700)
committerEvan Hunt <each@isc.org>
Fri, 22 Mar 2013 02:59:14 +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 64d0fa8c7cc5a4ee7b1d8953ec388ac415036ba8..f60ccc1054e6f7a9e89f33a141511d46fea76188 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 a8e1825a28a9b3bf3eca550909863f2a227aaa30..83f2b577af37b91a6c641afd1890bb3abd56e587 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 8d77c0de0d097a81550478cb49e8012a37692193..5ac214cbbad3791528752a444cab725404a91ba5 100644 (file)
@@ -566,6 +566,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;