aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-18 16:07:37 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2008-12-18 16:07:37 +0000
commitbff3891bdeefffd2b37ed5fa38c4bdaddd92b58a (patch)
tree2a0acbd0e549f407544bd574452e5d6d651997c2
parent837e09ea2ce21bbdfc01b413718038d332b186a2 (diff)
Do not crash if we are not passed in a followme id.
(closes issue #14106) Reported by: ys Patches: app_followme.c.2.diff uploaded by ys (license 281) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@165537 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_followme.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/app_followme.c b/apps/app_followme.c
index fca6facc2..b5bb5588c 100644
--- a/apps/app_followme.c
+++ b/apps/app_followme.c
@@ -960,22 +960,26 @@ static int app_exec(struct ast_channel *chan, void *data)
AST_APP_ARG(options);
);
+ if (ast_strlen_zero(data)) {
+ ast_log(LOG_WARNING, "%s requires an argument (followmeid)\n",app);
+ return -1;
+ }
+
if (!(argstr = ast_strdupa((char *)data))) {
ast_log(LOG_ERROR, "Out of memory!\n");
return -1;
}
- if (!data) {
- ast_log(LOG_WARNING, "%s requires an argument (followmeid)\n",app);
+
+ AST_STANDARD_APP_ARGS(args, argstr);
+ if (ast_strlen_zero(args.followmeid)) {
+ ast_log(LOG_WARNING, "%s requires an argument (followmeid)\n", app);
return -1;
}
u = ast_module_user_add(chan);
- AST_STANDARD_APP_ARGS(args, argstr);
-
- if (!ast_strlen_zero(args.followmeid))
- AST_LIST_LOCK(&followmes);
+ AST_LIST_LOCK(&followmes);
AST_LIST_TRAVERSE(&followmes, f, entry) {
if (!strcasecmp(f->name, args.followmeid) && (f->active))
break;