From 0cb9fc2dfb5b20b2baa135b2d7a6eb0d54c83217 Mon Sep 17 00:00:00 2001 From: tilghman Date: Tue, 15 Dec 2009 15:34:34 +0000 Subject: Merged revisions 235053 via svnmerge from 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: http://svn.digium.com/svn/asterisk/branches/1.6.0@235054 f38db490-d61c-443f-a65b-d21fe96a405b --- res/res_agi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/res/res_agi.c b/res/res_agi.c index 59fafeeac..4530e31b6 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1744,6 +1744,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)) -- cgit v1.2.3