From: Tilghman Lesher Date: Tue, 15 Dec 2009 15:29:24 +0000 (+0000) Subject: Mandatory argument checking X-Git-Tag: 1.4.29-rc1~30 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7d29ea864897b0d911da46453ef8481ed9fc27f;p=thirdparty%2Fasterisk.git Mandatory argument checking (closes issue #16446) Reported by: nicchap git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@235052 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_agi.c b/res/res_agi.c index fe53ebe680..665ccb1f5c 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1399,6 +1399,9 @@ static int handle_noop(struct ast_channel *chan, AGI *agi, int arg, char *argv[] static int handle_setmusic(struct ast_channel *chan, AGI *agi, int argc, char *argv[]) { + if (argc < 3) { + return RESULT_SHOWUSAGE; + } if (!strncasecmp(argv[2], "on", 2)) ast_moh_start(chan, argc > 3 ? argv[3] : NULL, NULL); else if (!strncasecmp(argv[2], "off", 3))