[asterisk-commits] kmoore: trunk r391777 - /trunk/main/cel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 14 11:12:46 CDT 2013


Author: kmoore
Date: Fri Jun 14 11:12:44 2013
New Revision: 391777

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=391777
Log:
Fix a crash in CEL bridge snapshot handling

Properly search for bridge association structures so that they are
found when expected and handle cases where they don't exist.

Modified:
    trunk/main/cel.c

Modified: trunk/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/cel.c?view=diff&rev=391777&r1=391776&r2=391777
==============================================================================
--- trunk/main/cel.c (original)
+++ trunk/main/cel.c Fri Jun 14 11:12:44 2013
@@ -1187,7 +1187,6 @@
 {
 	struct bridge_assoc *assoc = obj;
 	char *bridge_id = arg;
-	ast_assert(flags & OBJ_KEY);
 	if (!strcmp(bridge_id, assoc->bridge_id)) {
 		return CMP_MATCH;
 	}
@@ -1197,7 +1196,7 @@
 static struct bridge_assoc *find_bridge_primary_by_bridge_id(const char *bridge_id)
 {
 	char *dup_id = ast_strdupa(bridge_id);
-	return ao2_callback(bridge_primaries, OBJ_KEY, bridge_match_cb, dup_id);
+	return ao2_callback(bridge_primaries, 0, bridge_match_cb, dup_id);
 }
 
 static void clear_bridge_primary(const char *bridge_id)
@@ -1251,6 +1250,10 @@
 		if ((old_snapshot->capabilities & (AST_BRIDGE_CAPABILITY_1TO1MIX | AST_BRIDGE_CAPABILITY_NATIVE))
 			&& (new_snapshot->capabilities & AST_BRIDGE_CAPABILITY_MULTIMIX)) {
 			assoc = find_bridge_primary_by_bridge_id(new_snapshot->uniqueid);
+			if (!assoc) {
+				ast_log(LOG_ERROR, "No association found for bridge %s\n", new_snapshot->uniqueid);
+				return;
+			}
 
 			/* this bridge will no longer be treated like a bridge, so mark the bridge_assoc as such */
 			assoc->track_as_conf = 1;




More information about the asterisk-commits mailing list