[svn-commits] kpfleming: branch 1.4 r44476 - /branches/1.4/main/app.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Oct 5 09:10:02 MST 2006


Author: kpfleming
Date: Thu Oct  5 11:10:01 2006
New Revision: 44476

URL: http://svn.digium.com/view/asterisk?rev=44476&view=rev
Log:
don't segfault when an argument without a close parenthesis is found
stop parsing as soon as that situation occurs

Modified:
    branches/1.4/main/app.c

Modified: branches/1.4/main/app.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/app.c?rev=44476&r1=44475&r2=44476&view=diff
==============================================================================
--- branches/1.4/main/app.c (original)
+++ branches/1.4/main/app.c Thu Oct  5 11:10:01 2006
@@ -1302,14 +1302,14 @@
 		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;



More information about the svn-commits mailing list