[asterisk-commits] russell: branch 1.4 r53093 - /branches/1.4/funcs/func_strings.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Feb 1 14:24:53 MST 2007


Author: russell
Date: Thu Feb  1 15:24:52 2007
New Revision: 53093

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53093
Log:
Fix the FIELDQTY function to not crash. (reported by blitzrage and Corydon on IRC)

Modified:
    branches/1.4/funcs/func_strings.c

Modified: branches/1.4/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/funcs/func_strings.c?view=diff&rev=53093&r1=53092&r2=53093
==============================================================================
--- branches/1.4/funcs/func_strings.c (original)
+++ branches/1.4/funcs/func_strings.c Thu Feb  1 15:24:52 2007
@@ -46,7 +46,7 @@
 static int function_fieldqty(struct ast_channel *chan, char *cmd,
 			     char *parse, char *buf, size_t len)
 {
-	char *varname = NULL, *varsubst, varval[8192] = "", *varval2 = varval;
+	char *varsubst, varval[8192] = "", *varval2 = varval;
 	int fieldcount = 0;
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(varname);
@@ -55,9 +55,9 @@
 
 	AST_STANDARD_APP_ARGS(args, parse);
 	if (args.delim) {
-		varsubst = alloca(strlen(varname) + 4);
-
-		sprintf(varsubst, "${%s}", varname);
+		varsubst = alloca(strlen(args.varname) + 4);
+
+		sprintf(varsubst, "${%s}", args.varname);
 		pbx_substitute_variables_helper(chan, varsubst, varval, sizeof(varval) - 1);
 		while (strsep(&varval2, args.delim))
 			fieldcount++;



More information about the asterisk-commits mailing list