mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
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
This commit is contained in:
@@ -596,12 +596,15 @@ static int common_exec(struct ast_channel *chan, const struct ast_flags *flags,
|
||||
|
||||
if (ast_test_flag(flags, OPTION_EXIT)) {
|
||||
const char *c;
|
||||
if ((c = pbx_builtin_getvar_helper(chan, "SPY_EXIT_CONTEXT")))
|
||||
ast_channel_lock(chan);
|
||||
if ((c = pbx_builtin_getvar_helper(chan, "SPY_EXIT_CONTEXT"))) {
|
||||
ast_copy_string(exitcontext, c, sizeof(exitcontext));
|
||||
else if (!ast_strlen_zero(chan->macrocontext))
|
||||
} else if (!ast_strlen_zero(chan->macrocontext)) {
|
||||
ast_copy_string(exitcontext, chan->macrocontext, sizeof(exitcontext));
|
||||
else
|
||||
} else {
|
||||
ast_copy_string(exitcontext, chan->context, sizeof(exitcontext));
|
||||
}
|
||||
ast_channel_unlock(chan);
|
||||
}
|
||||
|
||||
ast_mutex_init(&chanspy_ds.lock);
|
||||
|
Reference in New Issue
Block a user