aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-12 18:44:36 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-12 18:44:36 +0000
commit91879350bec01432e41753f74715c608f14085fb (patch)
treea712d5cb7c75e76cccf049e5ae6a183e4b7951fe
parentcbb22ba26a195239fe78a1a438e2c2234ac6f590 (diff)
Based on a note in asterisk-dev by Brian Capouch, I determined I too agressive in not initializing arrays passed to pbx_substitute_variables_xxxx; I reviewed the code (again) and hopefully found every possible spot where substitute_variables is called conditionally, and made sure the char array involved was set to a null string.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89186 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--apps/app_exec.c2
-rw-r--r--apps/app_mixmonitor.c1
-rw-r--r--apps/app_queue.c2
-rw-r--r--cdr/cdr_manager.c1
-rw-r--r--funcs/func_logic.c2
-rw-r--r--main/pbx.c3
-rw-r--r--pbx/pbx_dundi.c1
-rw-r--r--pbx/pbx_realtime.c1
8 files changed, 11 insertions, 2 deletions
diff --git a/apps/app_exec.c b/apps/app_exec.c
index 830968400..6a13e1801 100644
--- a/apps/app_exec.c
+++ b/apps/app_exec.c
@@ -99,6 +99,7 @@ static int exec_exec(struct ast_channel *chan, void *data)
return 0;
s = ast_strdupa(data);
+ args[0] = 0;
appname = strsep(&s, "(");
if (s) {
endargs = strrchr(s, ')');
@@ -129,6 +130,7 @@ static int tryexec_exec(struct ast_channel *chan, void *data)
return 0;
s = ast_strdupa(data);
+ args[0] = 0;
appname = strsep(&s, "(");
if (s) {
endargs = strrchr(s, ')');
diff --git a/apps/app_mixmonitor.c b/apps/app_mixmonitor.c
index 4c705ad51..1583566fb 100644
--- a/apps/app_mixmonitor.c
+++ b/apps/app_mixmonitor.c
@@ -225,6 +225,7 @@ static void launch_monitor_thread(struct ast_channel *chan, const char *filename
len = sizeof(*mixmonitor) + strlen(chan->name) + strlen(filename) + 2;
+ postprocess2[0] = 0;
/* If a post process system command is given attach it to the structure */
if (!ast_strlen_zero(post_process)) {
char *p1, *p2;
diff --git a/apps/app_queue.c b/apps/app_queue.c
index 9042149c0..0b0ebac7d 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -2703,6 +2703,8 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce
struct ao2_iterator memi;
memset(&bridge_config, 0, sizeof(bridge_config));
+ tmpid[0] = 0;
+ meid[0] = 0;
time(&now);
for (; options && *options; options++)
diff --git a/cdr/cdr_manager.c b/cdr/cdr_manager.c
index 4fa66b560..062718039 100644
--- a/cdr/cdr_manager.c
+++ b/cdr/cdr_manager.c
@@ -142,6 +142,7 @@ static int manager_log(struct ast_cdr *cdr)
ast_localtime(&cdr->end, &timeresult, NULL);
ast_strftime(strEndTime, sizeof(strEndTime), DATE_FORMAT, &timeresult);
+ buf[0] = 0;
/* Custom fields handling */
if (customfields != NULL && customfields->used > 0) {
memset(&dummy, 0, sizeof(dummy));
diff --git a/funcs/func_logic.c b/funcs/func_logic.c
index 4093be800..1ec21eb9e 100644
--- a/funcs/func_logic.c
+++ b/funcs/func_logic.c
@@ -157,7 +157,7 @@ static int acf_import(struct ast_channel *chan, const char *cmd, char *data, cha
AST_APP_ARG(varname);
);
AST_STANDARD_APP_ARGS(args, data);
-
+ buf[0] = 0;
if (!ast_strlen_zero(args.varname)) {
struct ast_channel *chan2 = ast_get_channel_by_name_locked(args.channel);
if (chan2) {
diff --git a/main/pbx.c b/main/pbx.c
index 483bb762e..4d4fcd3b0 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -1652,6 +1652,7 @@ struct ast_exten *pbx_find_extension(struct ast_channel *chan,
continue;
}
/* Substitute variables now */
+
if (sw->eval)
pbx_substitute_variables_helper(chan, sw->data, sw->tmpdata, SWITCH_DATA_LENGTH - 1);
@@ -6886,7 +6887,7 @@ int pbx_builtin_importvar(struct ast_channel *chan, void *data)
ast_log(LOG_WARNING, "Ignoring, since there is no variable to set\n");
return 0;
}
-
+ tmp[0] = 0;
if (!deprecation_warning) {
ast_log(LOG_WARNING, "ImportVar is deprecated. Please use Set(varname=${IMPORT(channel,variable)}) instead.\n");
deprecation_warning = 1;
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c
index 2a03cb671..05748b397 100644
--- a/pbx/pbx_dundi.c
+++ b/pbx/pbx_dundi.c
@@ -535,6 +535,7 @@ static int get_mapping_weight(struct dundi_mapping *map)
{
char buf[32];
+ buf[0] = 0;
if (map->weightstr) {
pbx_substitute_variables_helper(NULL, map->weightstr, buf, sizeof(buf) - 1);
if (sscanf(buf, "%d", &map->_weight) != 1)
diff --git a/pbx/pbx_realtime.c b/pbx/pbx_realtime.c
index d733dc052..0d92fa720 100644
--- a/pbx/pbx_realtime.c
+++ b/pbx/pbx_realtime.c
@@ -196,6 +196,7 @@ static int realtime_exec(struct ast_channel *chan, const char *context, const ch
char tmp2[80];
char tmp3[EXT_DATA_SIZE];
+ appdata[0] = 0; /* just in case the substitute var func isn't called */
if(!ast_strlen_zero(tmp))
pbx_substitute_variables_helper(chan, tmp, appdata, sizeof(appdata) - 1);
ast_verb(3, "Executing %s(\"%s\", \"%s\")\n",