From: Walter Doekes Date: Tue, 8 Nov 2011 19:25:05 +0000 (+0000) Subject: Fix crash when dialplan remove include is called with too few arguments. X-Git-Tag: 1.8.9.0-rc1~96 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=833185c958cc7c022c8454113a8faaea5e8020e3;p=thirdparty%2Fasterisk.git Fix crash when dialplan remove include is called with too few arguments. "dialplan remove include x from y" crashed when the amount of arguments was less than 6. (closes issue ASTERISK-18762) Reported by: Andrey Solovyev Tested by: Andrey Solovyev git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@343936 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index eeec862b4b..d770748f1e 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -87,7 +87,7 @@ static char *handle_cli_dialplan_remove_include(struct ast_cli_entry *e, int cmd return complete_dialplan_remove_include(a); } - if (strcmp(a->argv[4], "from")) + if (a->argc != 6 || strcmp(a->argv[4], "from")) return CLI_SHOWUSAGE; if (!ast_context_remove_include(a->argv[5], a->argv[3], registrar)) {