From: Mark Andrews Date: Wed, 30 Apr 2014 06:09:16 +0000 (+1000) Subject: don't read past end of command line argument X-Git-Tag: v9.11.0a1~1684 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=23c7871cc799cff1a60ddca7d1404e939b30b458;p=thirdparty%2Fbind9.git don't read past end of command line argument --- diff --git a/bin/dig/dig.c b/bin/dig/dig.c index b7cd073a6d6..295f3662621 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -1303,16 +1303,22 @@ plus_option(char *option, isc_boolean_t is_batchfile, } break; case 't': - switch (cmd[3]) { - case 0: - case 'i': /* ttlid */ - FULLCHECK2("ttl", "ttlid"); - nottl = ISC_TF(!state); - break; - case 'u': /* ttlunits */ - FULLCHECK("ttlunits"); - nottl = ISC_FALSE; - ttlunits = ISC_TF(state); + switch (cmd[2]) { + case 'l': + switch (cmd[3]) { + case 0: + case 'i': /* ttlid */ + FULLCHECK2("ttl", "ttlid"); + nottl = ISC_TF(!state); + break; + case 'u': /* ttlunits */ + FULLCHECK("ttlunits"); + nottl = ISC_FALSE; + ttlunits = ISC_TF(state); + break; + default: + goto invalid_option; + } break; default: goto invalid_option;