aboutsummaryrefslogtreecommitdiffstats
path: root/main/app.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-05 16:10:01 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-05 16:10:01 +0000
commitb8b5177a79319cd74ee5b0c6d2a83104e0fe07f5 (patch)
tree4634edd3fdff942de3216fa8b55e88601a3deb3d /main/app.c
parent5d3a32773c350fc0d3e6fcce54a7ddb685160814 (diff)
don't segfault when an argument without a close parenthesis is found
stop parsing as soon as that situation occurs git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44476 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/app.c')
-rw-r--r--main/app.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/app.c b/main/app.c
index b6a7f73a9..e640a762e 100644
--- a/main/app.c
+++ b/main/app.c
@@ -1302,14 +1302,14 @@ int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags
if (*s == '(') {
/* Has argument */
arg = ++s;
- s = strchr(s, ')');
- if (*s) {
+ if ((s = strchr(s, ')'))) {
if (argloc)
args[argloc - 1] = arg;
*s++ = '\0';
} else {
ast_log(LOG_WARNING, "Missing closing parenthesis for argument '%c' in string '%s'\n", curarg, arg);
res = -1;
+ break;
}
} else if (argloc) {
args[argloc - 1] = NULL;