diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-30 19:21:04 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-04-30 19:21:04 +0000 |
commit | 527c601d0cf28b0b062a1e6d1ea1ec02cb9568dd (patch) | |
tree | 89d592fc9e276ed41a21062589ea44fedcf6d0d2 /apps/app_stack.c | |
parent | 4c3aecfc55663f0ed9d441aa2d2b2d4ddd35e28e (diff) |
Lock around variables retrieved, and copy the values, if they stay persistent,
since another thread could remove them.
(closes issue #12541)
Reported by: snuffy
Patches:
bug_12156_apps.diff uploaded by snuffy (license 35)
Several additional changes by me
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_stack.c')
-rw-r--r-- | apps/app_stack.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/app_stack.c b/apps/app_stack.c index 7f53aff15..56f946529 100644 --- a/apps/app_stack.c +++ b/apps/app_stack.c @@ -351,8 +351,11 @@ static int local_read(struct ast_channel *chan, const char *cmd, char *data, cha frame = AST_LIST_FIRST(oldlist); AST_LIST_TRAVERSE(&frame->varshead, variables, entries) { if (!strcmp(data, ast_var_name(variables))) { - const char *tmp = pbx_builtin_getvar_helper(chan, data); + const char *tmp; + ast_channel_lock(chan); + tmp = pbx_builtin_getvar_helper(chan, data); ast_copy_string(buf, S_OR(tmp, ""), len); + ast_channel_unlock(chan); break; } } |