]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 235053 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 15 Dec 2009 15:35:41 +0000 (15:35 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 15 Dec 2009 15:35:41 +0000 (15:35 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r235053 | tilghman | 2009-12-15 09:33:49 -0600 (Tue, 15 Dec 2009) | 11 lines

  Merged revisions 235052 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r235052 | tilghman | 2009-12-15 09:29:24 -0600 (Tue, 15 Dec 2009) | 4 lines

    Mandatory argument checking
    (closes issue #16446)
     Reported by: nicchap
  ........
................

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

res/res_agi.c

index be2794a636169f3daad74b00797e4b62b2ed9b31..d953a9d2ff8064bf158e020a6584a4875a1cca2e 100644 (file)
@@ -1721,6 +1721,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))