[asterisk-commits] trunk r36777 - /trunk/funcs/func_strings.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Jul 2 23:32:35 MST 2006


Author: tilghman
Date: Mon Jul  3 01:32:35 2006
New Revision: 36777

URL: http://svn.digium.com/view/asterisk?rev=36777&view=rev
Log:
Don't attempt to run a regcomp if we haven't even parsed arguments correctly

Modified:
    trunk/funcs/func_strings.c

Modified: trunk/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_strings.c?rev=36777&r1=36776&r2=36777&view=diff
==============================================================================
--- trunk/funcs/func_strings.c (original)
+++ trunk/funcs/func_strings.c Mon Jul  3 01:32:35 2006
@@ -118,6 +118,11 @@
 	buf[0] = '\0';
 
 	AST_NONSTANDARD_APP_ARGS(args, parse, '"');
+
+	if (args.argc != 3) {
+		ast_log(LOG_ERROR, "Unexpected arguments: should have been in the form '\"<regex>\" <string>'\n");
+		return -1;
+	}
 
 	ast_log(LOG_DEBUG, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str);
 



More information about the asterisk-commits mailing list