]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4582. [security] 'rndc ""' could trigger a assertion failure in named.
authorMark Andrews <marka@isc.org>
Fri, 24 Mar 2017 15:00:17 +0000 (02:00 +1100)
committerMark Andrews <marka@isc.org>
Fri, 24 Mar 2017 15:10:09 +0000 (02:10 +1100)
                        (CVE-2017-3138) [RT #44924]

(cherry picked from commit 8e8dfc5941e2375f2f8dadf3706258dd0db5f2e6)

CHANGES
bin/tests/system/rndc/tests.sh
lib/isc/include/isc/lex.h
lib/isc/lex.c

diff --git a/CHANGES b/CHANGES
index 12d0ebe3adcc9c33f0d6f50998b0275925904051..280d3e54a8d8fd4795528fb53d453b4162f6c175 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
        --- 9.9.9-P8 released ---
 
+4582.  [security]      'rndc ""' could trigger a assertion failure in named.
+                       (CVE-2017-3138) [RT #44924]
+
 4580.  [bug]           4578 introduced a regression when handling CNAME to
                        referral below the current domain. [RT #44850]
 
index 6029e08d39a26e888e3dd672d3fc3d3d195de73b..8b318486f4803b89d670281c5e083387f4d6225b 100644 (file)
@@ -297,5 +297,13 @@ sleep 1
 if [ $ret != 0 ]; then echo "I:failed"; fi
 status=`expr $status + $ret`
 
+n=`expr $n + 1`
+echo "I:check 'rndc \"\"' is handled ($n)"
+ret=0
+$RNDCCMD "" > rndc.out.test$n 2>&1 && ret=1
+grep "rndc: '' failed: failure" rndc.out.test$n > /dev/null
+if [ $ret != 0 ]; then echo "I:failed"; fi
+status=`expr $status + $ret`
+
 echo "I:exit status: $status"
 exit $status
index 8612150991bc8ca5affe8acb7d80a71a6bf66305..81af3af17afed8d77cf3af9e35bf834a2c807d02 100644 (file)
@@ -152,8 +152,6 @@ isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp);
  * Requires:
  *\li  '*lexp' is a valid lexer.
  *
- *\li  max_token > 0.
- *
  * Ensures:
  *\li  On success, *lexp is attached to the newly created lexer.
  *
index ce1c5599412fd56a79db1e505726e5552834404e..fa6e03fed826260ef31c9a084e0f4986aaac9297 100644 (file)
@@ -94,9 +94,10 @@ isc_lex_create(isc_mem_t *mctx, size_t max_token, isc_lex_t **lexp) {
        /*
         * Create a lexer.
         */
-
        REQUIRE(lexp != NULL && *lexp == NULL);
-       REQUIRE(max_token > 0U);
+
+       if (max_token == 0U)
+               max_token = 1;
 
        lex = isc_mem_get(mctx, sizeof(*lex));
        if (lex == NULL)