diff options
author | Matthew Jordan <mjordan@digium.com> | 2013-09-28 20:27:23 +0000 |
---|---|---|
committer | Matthew Jordan <mjordan@digium.com> | 2013-09-28 20:27:23 +0000 |
commit | 2ef63eaf3402575706533eb400c09eb3bebe6c48 (patch) | |
tree | 909d300a49e1a67853a0ae4f6a143b8c8e90902a | |
parent | 2b32732aa814647d5a098043225c9a66eefb76d9 (diff) |
manager: Fix crash when appending a manager channel variable
In r399887, a minor performance improvement was introduced by not allocating
the manager variable struct if it wasn't used. Unfortunately, when directly
accessing an ast_channel struct, manager assumed that the struct was always
allocated. Since this was no longer the case, things got a bit crashy.
This fixes that problem by simply bypassing appending variables if the manager
channel variable struct isn't there.
........
Merged revisions 400058 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r-- | main/manager.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/main/manager.c b/main/manager.c index c8b0e4708..00649dafa 100644 --- a/main/manager.c +++ b/main/manager.c @@ -5934,6 +5934,10 @@ static void append_channel_vars(struct ast_str **pbuf, struct ast_channel *chan) vars = ast_channel_get_manager_vars(chan); + if (!vars) { + return; + } + AST_LIST_TRAVERSE(vars, var, entries) { ast_str_append(pbuf, 0, "ChanVariable(%s): %s=%s\r\n", ast_channel_name(chan), var->name, var->value); } |