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

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 ed3a2ec1b683541adc1e25ccafbbdb137b30f80e..b81db912f85c669a8994ea42fd0a6070b04bfc10 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 d21452d27da48577f66fe942f632871e14bcc81c..59643b12cf8bb6418a06d8a394396a676aad48d8 100644 (file)
@@ -28,6 +28,16 @@ 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
+
 echo "I:checking with journal file ($n)"
 ret=0
 $CHECKZONE -D -o test.orig.db test zones/test1.db > /dev/null 2>&1 || ret=1
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 caa5d2e994407ed049adeccced364261a341e7f3..860f59e0bbe227136a6c00e9695e8107f10a0da0 100644 (file)
@@ -584,6 +584,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;