]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Mandatory argument checking
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 15 Dec 2009 15:29:24 +0000 (15:29 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 15 Dec 2009 15:29:24 +0000 (15:29 +0000)
(closes issue #16446)
 Reported by: nicchap

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@235052 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_agi.c

index fe53ebe68021bf5e01f34a90dafdaf5864abe16d..665ccb1f5ceb5c88016227f26f8cec2c0de84b7d 100644 (file)
@@ -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))