aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authormmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-27 18:09:43 +0000
committermmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-01-27 18:09:43 +0000
commit5291e1efaeef6de03ce576d979e517afb08d6189 (patch)
tree6224c6336ab23b576f694029a9799655fba68c99 /main
parent4c2bb32fdf2910133db0d02854f73afc63288133 (diff)
Merged revisions 243487 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r243487 | mmichelson | 2010-01-27 12:08:02 -0600 (Wed, 27 Jan 2010) | 9 lines Merged revisions 243486 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r243486 | mmichelson | 2010-01-27 12:06:43 -0600 (Wed, 27 Jan 2010) | 3 lines Use a safe list traversal while checking for duplicate vars in pbx_builtin_setvar_helper. ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@243489 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c
index daae9b571..8f792a530 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -8477,14 +8477,15 @@ void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const
nametail++;
}
- AST_LIST_TRAVERSE (headp, newvariable, entries) {
+ AST_LIST_TRAVERSE_SAFE_BEGIN(headp, newvariable, entries) {
if (strcasecmp(ast_var_name(newvariable), nametail) == 0) {
/* there is already such a variable, delete it */
- AST_LIST_REMOVE(headp, newvariable, entries);
+ AST_LIST_REMOVE_CURRENT(entries);
ast_var_delete(newvariable);
break;
}
}
+ AST_LIST_TRAVERSE_SAFE_END;
if (value) {
if (headp == &globals)