[asterisk-commits] murf: branch murf/fast-ast3 r88009 - in /team/murf/fast-ast3: apps/ cdr/ func...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 1 01:11:51 CDT 2007


Author: murf
Date: Thu Nov  1 01:11:50 2007
New Revision: 88009

URL: http://svn.digium.com/view/asterisk?view=rev&rev=88009
Log:
Went around and erased all the places where the buffer was initialized before passing to substitute_variables_helper... just to be consistent. Got 100K pips from another perf test. This meets my goals for the moment.

Modified:
    team/murf/fast-ast3/apps/app_exec.c
    team/murf/fast-ast3/apps/app_macro.c
    team/murf/fast-ast3/apps/app_minivm.c
    team/murf/fast-ast3/apps/app_mixmonitor.c
    team/murf/fast-ast3/apps/app_playback.c
    team/murf/fast-ast3/apps/app_queue.c
    team/murf/fast-ast3/apps/app_rpt.c
    team/murf/fast-ast3/cdr/cdr_custom.c
    team/murf/fast-ast3/cdr/cdr_manager.c
    team/murf/fast-ast3/cdr/cdr_sqlite3_custom.c
    team/murf/fast-ast3/funcs/func_cut.c
    team/murf/fast-ast3/funcs/func_logic.c
    team/murf/fast-ast3/funcs/func_odbc.c
    team/murf/fast-ast3/funcs/func_strings.c
    team/murf/fast-ast3/main/logger.c
    team/murf/fast-ast3/main/pbx.c
    team/murf/fast-ast3/pbx/pbx_config.c
    team/murf/fast-ast3/pbx/pbx_dundi.c
    team/murf/fast-ast3/pbx/pbx_loopback.c
    team/murf/fast-ast3/pbx/pbx_realtime.c
    team/murf/fast-ast3/res/ael/pval.c
    team/murf/fast-ast3/res/res_agi.c
    team/murf/fast-ast3/utils/extconf.c

Modified: team/murf/fast-ast3/apps/app_exec.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/apps/app_exec.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/apps/app_exec.c (original)
+++ team/murf/fast-ast3/apps/app_exec.c Thu Nov  1 01:11:50 2007
@@ -92,7 +92,7 @@
 static int exec_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	char *s, *appname, *endargs, args[MAXRESULT] = "";
+	char *s, *appname, *endargs, args[MAXRESULT];
 	struct ast_app *app;
 
 	if (ast_strlen_zero(data))
@@ -122,7 +122,7 @@
 static int tryexec_exec(struct ast_channel *chan, void *data)
 {
 	int res = 0;
-	char *s, *appname, *endargs, args[MAXRESULT] = "";
+	char *s, *appname, *endargs, args[MAXRESULT];
 	struct ast_app *app;
 
 	if (ast_strlen_zero(data))

Modified: team/murf/fast-ast3/apps/app_macro.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/apps/app_macro.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/apps/app_macro.c (original)
+++ team/murf/fast-ast3/apps/app_macro.c Thu Nov  1 01:11:50 2007
@@ -331,7 +331,7 @@
 			gosub_level++;
 			ast_debug(1, "Incrementing gosub_level\n");
 		} else if (!strcasecmp(runningapp, "GOSUBIF")) {
-			char tmp2[1024] = "", *cond, *app, *app2 = tmp2;
+			char tmp2[1024], *cond, *app, *app2 = tmp2;
 			pbx_substitute_variables_helper(chan, runningdata, tmp2, sizeof(tmp2) - 1);
 			cond = strsep(&app2, "?");
 			app = strsep(&app2, ":");
@@ -354,7 +354,7 @@
 			ast_debug(1, "Decrementing gosub_level\n");
 		} else if (!strncasecmp(runningapp, "EXEC", 4)) {
 			/* Must evaluate args to find actual app */
-			char tmp2[1024] = "", *tmp3 = NULL;
+			char tmp2[1024], *tmp3 = NULL;
 			pbx_substitute_variables_helper(chan, runningdata, tmp2, sizeof(tmp2) - 1);
 			if (!strcasecmp(runningapp, "EXECIF")) {
 				tmp3 = strchr(tmp2, '|');

Modified: team/murf/fast-ast3/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/apps/app_minivm.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/apps/app_minivm.c (original)
+++ team/murf/fast-ast3/apps/app_minivm.c Thu Nov  1 01:11:50 2007
@@ -1025,7 +1025,6 @@
 
 		ast_debug(4, "-_-_- Fromaddress template: %s\n", fromaddress);
 		if ((passdata = alloca(vmlen))) {
-			memset(passdata, 0, vmlen);
 			pbx_substitute_variables_helper(ast, fromaddress, passdata, vmlen);
 			len_passdata = strlen(passdata) * 2 + 3;
 			passdata2 = alloca(len_passdata);
@@ -1050,7 +1049,6 @@
 		char *passdata;
 		int vmlen = strlen(template->subject) * 3 + 200;
 		if ((passdata = alloca(vmlen))) {
-			memset(passdata, 0, vmlen);
 			pbx_substitute_variables_helper(ast, template->subject, passdata, vmlen);
 			fprintf(p, "Subject: %s\n", passdata);
 		} else {
@@ -1082,7 +1080,6 @@
 		char *passdata;
 		int vmlen = strlen(template->body)*3 + 200;
 		if ((passdata = alloca(vmlen))) {
-			memset(passdata, 0, vmlen);
 			pbx_substitute_variables_helper(ast, template->body, passdata, vmlen);
 			ast_debug(3, "Message now: %s\n-----\n", passdata);
 			fprintf(p, "%s\n", passdata);

Modified: team/murf/fast-ast3/apps/app_mixmonitor.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/apps/app_mixmonitor.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/apps/app_mixmonitor.c (original)
+++ team/murf/fast-ast3/apps/app_mixmonitor.c Thu Nov  1 01:11:50 2007
@@ -220,7 +220,7 @@
 {
 	pthread_t thread;
 	struct mixmonitor *mixmonitor;
-	char postprocess2[1024] = "";
+	char postprocess2[1024];
 	size_t len;
 
 	len = sizeof(*mixmonitor) + strlen(chan->name) + strlen(filename) + 2;
@@ -235,7 +235,6 @@
 				*p2 = '$';
 			}
 		}
-
 		pbx_substitute_variables_helper(chan, p1, postprocess2, sizeof(postprocess2) - 1);
 		if (!ast_strlen_zero(postprocess2))
 			len += strlen(postprocess2) + 1;

Modified: team/murf/fast-ast3/apps/app_playback.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/apps/app_playback.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/apps/app_playback.c (original)
+++ team/murf/fast-ast3/apps/app_playback.c Thu Nov  1 01:11:50 2007
@@ -202,7 +202,6 @@
 		ast_trim_blanks(x);
 
 		/* replace variables */
-		memset(fn, 0, sizeof(fn)); /* XXX why isn't done in pbx_substitute_variables_helper! */
 		pbx_substitute_variables_varshead(&head, x, fn, sizeof(fn));
 		ast_log(LOG_WARNING, "doing [%s]\n", fn);
 

Modified: team/murf/fast-ast3/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/apps/app_queue.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/apps/app_queue.c (original)
+++ team/murf/fast-ast3/apps/app_queue.c Thu Nov  1 01:11:50 2007
@@ -2978,7 +2978,6 @@
 					if (p == tmpid2 + sizeof(tmpid2))
 						tmpid2[sizeof(tmpid2) - 1] = '\0';
 
-					memset(tmpid, 0, sizeof(tmpid));
 					pbx_substitute_variables_helper(qe->chan, tmpid2, tmpid, sizeof(tmpid) - 1);
 				}
 
@@ -3005,7 +3004,6 @@
 					if (p == meid2 + sizeof(meid2))
 						meid2[sizeof(meid2) - 1] = '\0';
 
-					memset(meid, 0, sizeof(meid));
 					pbx_substitute_variables_helper(qe->chan, meid2, meid, sizeof(meid) - 1);
 				}
 	

Modified: team/murf/fast-ast3/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/apps/app_rpt.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/apps/app_rpt.c (original)
+++ team/murf/fast-ast3/apps/app_rpt.c Thu Nov  1 01:11:50 2007
@@ -6936,7 +6936,7 @@
 		struct ast_hostent ahp;
 		struct hostent *hp;
 		struct in_addr ia;
-		char hisip[100] = "", nodeip[100];
+		char hisip[100], nodeip[100];
 		const char *val;
 		char *s, *s1, *s2;
 

Modified: team/murf/fast-ast3/cdr/cdr_custom.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/cdr/cdr_custom.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/cdr/cdr_custom.c (original)
+++ team/murf/fast-ast3/cdr/cdr_custom.c Thu Nov  1 01:11:50 2007
@@ -119,7 +119,6 @@
 	if (ast_strlen_zero(master))
 		return 0;
 
-	memset(buf, 0 , sizeof(buf));
 	/* Quite possibly the first use of a static struct ast_channel, we need it so the var funcs will work */
 	memset(&dummy, 0, sizeof(dummy));
 	dummy.cdr = cdr;

Modified: team/murf/fast-ast3/cdr/cdr_manager.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/cdr/cdr_manager.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/cdr/cdr_manager.c (original)
+++ team/murf/fast-ast3/cdr/cdr_manager.c Thu Nov  1 01:11:50 2007
@@ -143,7 +143,6 @@
 	ast_strftime(strEndTime, sizeof(strEndTime), DATE_FORMAT, &timeresult);
 
 	/* Custom fields handling */
-	memset(buf, 0 , sizeof(buf));
 	if (customfields != NULL && customfields->used > 0) {
 		memset(&dummy, 0, sizeof(dummy));
 		dummy.cdr = cdr;

Modified: team/murf/fast-ast3/cdr/cdr_sqlite3_custom.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/cdr/cdr_sqlite3_custom.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/cdr/cdr_sqlite3_custom.c (original)
+++ team/murf/fast-ast3/cdr/cdr_sqlite3_custom.c Thu Nov  1 01:11:50 2007
@@ -158,7 +158,7 @@
 
 	{ /* Make it obvious that only sql_cmd should be used outside of this block */
 		char *sql_tmp_cmd;
-		char sql_insert_cmd[2048] = "";
+		char sql_insert_cmd[2048];
 		sql_tmp_cmd = sqlite3_mprintf("INSERT INTO %q (%q) VALUES (%q)", table, columns, values);
 		dummy.cdr = cdr;
 		pbx_substitute_variables_helper(&dummy, sql_tmp_cmd, sql_insert_cmd, sizeof(sql_insert_cmd) - 1);

Modified: team/murf/fast-ast3/funcs/func_cut.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/funcs/func_cut.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/funcs/func_cut.c (original)
+++ team/murf/fast-ast3/funcs/func_cut.c Thu Nov  1 01:11:50 2007
@@ -141,7 +141,6 @@
 
 		if (tmp) {
 			snprintf(tmp, strlen(args.varname) + 4, "${%s}", args.varname);
-			memset(varvalue, 0, sizeof(varvalue));
 		} else {
 			return ERROR_NOMEM;
 		}

Modified: team/murf/fast-ast3/funcs/func_logic.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/funcs/func_logic.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/funcs/func_logic.c (original)
+++ team/murf/fast-ast3/funcs/func_logic.c Thu Nov  1 01:11:50 2007
@@ -157,7 +157,6 @@
 		AST_APP_ARG(varname);
 	);
 	AST_STANDARD_APP_ARGS(args, data);
-	memset(buf, 0, len);
 
 	if (!ast_strlen_zero(args.varname)) {
 		struct ast_channel *chan2 = ast_get_channel_by_name_locked(args.channel);

Modified: team/murf/fast-ast3/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/funcs/func_odbc.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/funcs/func_odbc.c (original)
+++ team/murf/fast-ast3/funcs/func_odbc.c Thu Nov  1 01:11:50 2007
@@ -138,7 +138,7 @@
 {
 	struct odbc_obj *obj = NULL;
 	struct acf_odbc_query *query;
-	char *t, buf[2048]="", varname[15];
+	char *t, buf[2048], varname[15];
 	int i, dsn, bogus_chan = 0;
 	AST_DECLARE_APP_ARGS(values,
 		AST_APP_ARG(field)[100];
@@ -256,7 +256,7 @@
 {
 	struct odbc_obj *obj = NULL;
 	struct acf_odbc_query *query;
-	char sql[2048] = "", varname[15], colnames[2048] = "", rowcount[12] = "-1";
+	char sql[2048], varname[15], colnames[2048] = "", rowcount[12] = "-1";
 	int res, x, y, buflen = 0, escapecommas, rowlimit = 1, dsn, bogus_chan = 0;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(field)[100];

Modified: team/murf/fast-ast3/funcs/func_strings.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/funcs/func_strings.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/funcs/func_strings.c (original)
+++ team/murf/fast-ast3/funcs/func_strings.c Thu Nov  1 01:11:50 2007
@@ -48,7 +48,7 @@
 static int function_fieldqty(struct ast_channel *chan, const char *cmd,
 			     char *parse, char *buf, size_t len)
 {
-	char *varsubst, varval[8192] = "", *varval2 = varval;
+	char *varsubst, varval[8192], *varval2 = varval;
 	int fieldcount = 0;
 	AST_DECLARE_APP_ARGS(args,
 			     AST_APP_ARG(varname);
@@ -734,8 +734,6 @@
 static int function_eval(struct ast_channel *chan, const char *cmd, char *data,
 			 char *buf, size_t len)
 {
-	memset(buf, 0, len);
-
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "EVAL requires an argument: EVAL(<string>)\n");
 		return -1;

Modified: team/murf/fast-ast3/main/logger.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/main/logger.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/main/logger.c (original)
+++ team/murf/fast-ast3/main/logger.c Thu Nov  1 01:11:50 2007
@@ -505,7 +505,7 @@
 
 	if (!ast_strlen_zero(exec_after_rotate)) {
 		struct ast_channel *c = ast_channel_alloc(0, 0, "", "", "", "", "", 0, "Logger/rotate");
-		char buf[512] = "";
+		char buf[512];
 		pbx_builtin_setvar_helper(c, "filename", filename);
 		pbx_substitute_variables_helper(c, exec_after_rotate, buf, sizeof(buf));
 		system(buf);

Modified: team/murf/fast-ast3/main/pbx.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/main/pbx.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/main/pbx.c (original)
+++ team/murf/fast-ast3/main/pbx.c Thu Nov  1 01:11:50 2007
@@ -1618,8 +1618,7 @@
 
 static void pbx_substitute_variables_helper_full(struct ast_channel *c, struct varshead *headp, const char *cp1, char *cp2, int count)
 {
-	/* Substitutes variables into cp2, based on string cp1, and assuming cp2 to be
-	   zero-filled */
+	/* Substitutes variables into cp2, based on string cp1, cp2 NO LONGER NEEDS TO BE ZEROED OUT!!!!  */
 	char *cp4;
 	const char *tmp, *whereweare;
 	int length, offset, offset2, isfunction;
@@ -1628,7 +1627,8 @@
 	char *nextvar, *nextexp, *nextthing;
 	char *vars, *vare;
 	int pos, brackets, needsub, len;
-
+	
+	*cp2 = 0; /* just in case nothing ends up there */
 	whereweare=tmp=cp1;
 	while (!ast_strlen_zero(whereweare) && count) {
 		/* Assume we're copying the whole remaining string */
@@ -1703,7 +1703,6 @@
 				if (!ltmp)
 					ltmp = alloca(VAR_BUF_SIZE);
 
-				/* memset(ltmp, 0, VAR_BUF_SIZE); */
 				pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1);
 				vars = ltmp;
 			} else {
@@ -1791,7 +1790,6 @@
 				if (!ltmp)
 					ltmp = alloca(VAR_BUF_SIZE);
 
-				/* memset(ltmp, 0, VAR_BUF_SIZE); */
 				pbx_substitute_variables_helper_full(c, headp, var, ltmp, VAR_BUF_SIZE - 1);
 				vars = ltmp;
 			} else {
@@ -1823,7 +1821,6 @@
 static void pbx_substitute_variables(char *passdata, int datalen, struct ast_channel *c, struct ast_exten *e)
 {
 	const char *tmp;
-	/* memset(passdata, 0, datalen); */
 
 	/* Nothing more to do */
 	if (!e->data)
@@ -4932,7 +4929,7 @@
 	int res;
 	int length;
 	char *p;
-	char expand_buf[VAR_BUF_SIZE] = { 0, };
+	char expand_buf[VAR_BUF_SIZE];
 
 	/* if we are adding a hint, and there are global variables, and the hint
 	   contains variable references, then expand them
@@ -6080,7 +6077,7 @@
 	char *name;
 	char *value;
 	char *channel;
-	char tmp[VAR_BUF_SIZE]="";
+	char tmp[VAR_BUF_SIZE];
 	static int deprecation_warning = 0;
 
 	if (ast_strlen_zero(data)) {

Modified: team/murf/fast-ast3/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/pbx/pbx_config.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/pbx/pbx_config.c (original)
+++ team/murf/fast-ast3/pbx/pbx_config.c Thu Nov  1 01:11:50 2007
@@ -1390,7 +1390,6 @@
 		ast_copy_string(userscontext, "default", sizeof(userscontext));
 								    
 	for (v = ast_variable_browse(cfg, "globals"); v; v = v->next) {
-		memset(realvalue, 0, sizeof(realvalue));
 		pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
 		pbx_builtin_setvar_helper(NULL, v->name, realvalue);
 	}
@@ -1487,20 +1486,17 @@
 					free(tc);
 				}
 			} else if (!strcasecmp(v->name, "include")) {
-				memset(realvalue, 0, sizeof(realvalue));
 				pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
 				if (ast_context_add_include2(con, realvalue, registrar))
 					ast_log(LOG_WARNING, "Unable to include context '%s' in context '%s'\n", v->value, cxt);
 			} else if (!strcasecmp(v->name, "ignorepat")) {
-				memset(realvalue, 0, sizeof(realvalue));
 				pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
 				if (ast_context_add_ignorepat2(con, realvalue, registrar))
 					ast_log(LOG_WARNING, "Unable to include ignorepat '%s' in context '%s'\n", v->value, cxt);
 			} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
 				char *stringp = realvalue;
 				char *appl, *data;
-
-				memset(realvalue, 0, sizeof(realvalue));
+				
 				if (!strcasecmp(v->name, "switch"))
 					pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
 				else

Modified: team/murf/fast-ast3/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/pbx/pbx_dundi.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/pbx/pbx_dundi.c (original)
+++ team/murf/fast-ast3/pbx/pbx_dundi.c Thu Nov  1 01:11:50 2007
@@ -533,7 +533,7 @@
 
 static int get_mapping_weight(struct dundi_mapping *map)
 {
-	char buf[32] = "";
+	char buf[32];
 
 	if (map->weightstr) {
 		pbx_substitute_variables_helper(NULL, map->weightstr, buf, sizeof(buf) - 1);

Modified: team/murf/fast-ast3/pbx/pbx_loopback.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/pbx/pbx_loopback.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/pbx/pbx_loopback.c (original)
+++ team/murf/fast-ast3/pbx/pbx_loopback.c Thu Nov  1 01:11:50 2007
@@ -87,7 +87,6 @@
 	char tmp[80];
 
 	snprintf(tmp, sizeof(tmp), "%d", priority);
-	memset(buf, 0, buflen);
 	AST_LIST_HEAD_INIT_NOLOCK(&headp);
 	AST_LIST_INSERT_HEAD(&headp, ast_var_assign("EXTEN", exten), entries);
 	AST_LIST_INSERT_HEAD(&headp, ast_var_assign("CONTEXT", context), entries);

Modified: team/murf/fast-ast3/pbx/pbx_realtime.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/pbx/pbx_realtime.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/pbx/pbx_realtime.c (original)
+++ team/murf/fast-ast3/pbx/pbx_realtime.c Thu Nov  1 01:11:50 2007
@@ -191,7 +191,7 @@
 		if (!ast_strlen_zero(app)) {
 			struct ast_app *a = pbx_findapp(app);
 			if (a) {
-				char appdata[512]="";
+				char appdata[512];
 				char tmp1[80];
 				char tmp2[80];
 				char tmp3[EXT_DATA_SIZE];

Modified: team/murf/fast-ast3/res/ael/pval.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/res/ael/pval.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/res/ael/pval.c (original)
+++ team/murf/fast-ast3/res/ael/pval.c Thu Nov  1 01:11:50 2007
@@ -3788,7 +3788,6 @@
 	do {
 		struct ael_priority *last = 0;
 		
-		memset(realext, '\0', sizeof(realext)); /* make sure this is properly initialized */
 		pbx_substitute_variables_helper(NULL, exten->name, realext, sizeof(realext) - 1);
 		if (exten->hints) {
 			if (ast_add_extension2(exten->context, 0 /*no replace*/, realext, PRIORITY_HINT, NULL, exten->cidmatch, 

Modified: team/murf/fast-ast3/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/res/res_agi.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/res/res_agi.c (original)
+++ team/murf/fast-ast3/res/res_agi.c Thu Nov  1 01:11:50 2007
@@ -1192,7 +1192,7 @@
 
 static int handle_getvariablefull(struct ast_channel *chan, AGI *agi, int argc, char **argv)
 {
-	char tmp[4096] = "";
+	char tmp[4096];
 	struct ast_channel *chan2=NULL;
 
 	if ((argc != 4) && (argc != 5))

Modified: team/murf/fast-ast3/utils/extconf.c
URL: http://svn.digium.com/view/asterisk/team/murf/fast-ast3/utils/extconf.c?view=diff&rev=88009&r1=88008&r2=88009
==============================================================================
--- team/murf/fast-ast3/utils/extconf.c (original)
+++ team/murf/fast-ast3/utils/extconf.c Thu Nov  1 01:11:50 2007
@@ -5700,6 +5700,7 @@
 	char *vars, *vare;
 	int pos, brackets, needsub, len;
 
+	*cp2 = 0; /* just in case there's nothing to do */
 	whereweare=tmp=cp1;
 	while (!ast_strlen_zero(whereweare) && count) {
 		/* Assume we're copying the whole remaining string */
@@ -5731,6 +5732,7 @@
 			count -= pos;
 			cp2 += pos;
 			whereweare += pos;
+			*cp2 = 0;
 		}
 
 		if (nextvar) {
@@ -5802,6 +5804,7 @@
 				memcpy(cp2, cp4, length);
 				count -= length;
 				cp2 += length;
+				*cp2 = 0;
 			}
 		} else if (nextexp) {
 			/* We have an expression.  Find the start and end, and determine
@@ -5859,6 +5862,7 @@
 					ast_log(LOG_DEBUG, "Expression result is '%s'\n", cp2);
 				count -= length;
 				cp2 += length;
+				*cp2 = 0;
 			}
 		} else
 			break;




More information about the asterisk-commits mailing list