aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-15 15:29:24 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-12-15 15:29:24 +0000
commitf28555fd0246e690b166957a2be7f2b7dd8a6de4 (patch)
tree0876adecb1b8378dd0fed35573037f0276fa2076
parent23ecef3fe549947cab2edd7a6f47bac963299b06 (diff)
Mandatory argument checking
(closes issue #16446) Reported by: nicchap git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@235052 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--res/res_agi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/res_agi.c b/res/res_agi.c
index fe53ebe68..665ccb1f5 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))