[svn-commits] mjordan: trunk r400059 - in /trunk: ./ main/manager.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat Sep 28 15:27:24 CDT 2013


Author: mjordan
Date: Sat Sep 28 15:27:23 2013
New Revision: 400059

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=400059
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.
........

Merged revisions 400058 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/main/manager.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-12-merged' - no diff available.

Modified: trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=400059&r1=400058&r2=400059
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Sat Sep 28 15:27:23 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 svn-commits mailing list