mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 20:20:07 +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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user