From: Evan Hunt Date: Fri, 22 Mar 2013 02:30:10 +0000 (-0700) Subject: [master] zone parsing broken with embedded null X-Git-Tag: v9.10.0a1~448^2~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4bf686cf5d6b83981abdf2d8157c829922acc6d4;p=thirdparty%2Fbind9.git [master] zone parsing broken with embedded null 3534. [bug] Extra text after an embedded NULL was ignored when parsing zone files. [RT #32699] --- diff --git a/CHANGES b/CHANGES index ed3a2ec1b68..b81db912f85 100644 --- 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] diff --git a/bin/tests/system/checkzone/tests.sh b/bin/tests/system/checkzone/tests.sh index d21452d27da..59643b12cf8 100644 --- a/bin/tests/system/checkzone/tests.sh +++ b/bin/tests/system/checkzone/tests.sh @@ -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 index 00000000000..b9f3ecb9150 Binary files /dev/null and b/bin/tests/system/checkzone/zones/bad1.db differ diff --git a/lib/dns/master.c b/lib/dns/master.c index caa5d2e9944..860f59e0bbe 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -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;