[asterisk-commits] mjordan: branch 12 r400058 - /branches/12/main/manager.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Sep 28 15:20:45 CDT 2013
Author: mjordan
Date: Sat Sep 28 15:20:42 2013
New Revision: 400058
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400058
Log:
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.
Modified:
branches/12/main/manager.c
Modified: branches/12/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/main/manager.c?view=diff&rev=400058&r1=400057&r2=400058
==============================================================================
--- branches/12/main/manager.c (original)
+++ branches/12/main/manager.c Sat Sep 28 15:20:42 2013
@@ -5934,6 +5934,10 @@
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);
}
More information about the asterisk-commits
mailing list