[asterisk-commits] rmudgett: trunk r390068 - in /trunk: ./ main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 29 15:24:22 CDT 2013


Author: rmudgett
Date: Wed May 29 15:24:18 2013
New Revision: 390068

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390068
Log:
Fix segfault when dealing with chan_agent channels.

Check the returned bridged pointer for NULL to avoid a crash.  It looks
like chan_agent is returning a NULL pointer when it probably should be
returning a pointer to the channel the Agent channel is pretending to be.

(closes issue ASTERISK-21793)
Reported by: Rodrigo P. Telles
Patches:
      jira_asterisk_21793_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: Rodrigo P. Telles
........

Merged revisions 390044 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 390047 from http://svn.asterisk.org/svn/asterisk/branches/11

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

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

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=390068&r1=390067&r2=390068
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Wed May 29 15:24:18 2013
@@ -6638,14 +6638,14 @@
 	linkedid = oldest_linkedid(linkedid, ast_channel_uniqueid(peer));
 	if (ast_channel_internal_bridged_channel(chan)) {
 		bridged = ast_bridged_channel(chan);
-		if (bridged != peer) {
+		if (bridged && bridged != peer) {
 			linkedid = oldest_linkedid(linkedid, ast_channel_linkedid(bridged));
 			linkedid = oldest_linkedid(linkedid, ast_channel_uniqueid(bridged));
 		}
 	}
 	if (ast_channel_internal_bridged_channel(peer)) {
 		bridged = ast_bridged_channel(peer);
-		if (bridged != chan) {
+		if (bridged && bridged != chan) {
 			linkedid = oldest_linkedid(linkedid, ast_channel_linkedid(bridged));
 			linkedid = oldest_linkedid(linkedid, ast_channel_uniqueid(bridged));
 		}
@@ -6658,13 +6658,13 @@
 	ast_channel_change_linkedid(peer, linkedid);
 	if (ast_channel_internal_bridged_channel(chan)) {
 		bridged = ast_bridged_channel(chan);
-		if (bridged != peer) {
+		if (bridged && bridged != peer) {
 			ast_channel_change_linkedid(bridged, linkedid);
 		}
 	}
 	if (ast_channel_internal_bridged_channel(peer)) {
 		bridged = ast_bridged_channel(peer);
-		if (bridged != chan) {
+		if (bridged && bridged != chan) {
 			ast_channel_change_linkedid(bridged, linkedid);
 		}
 	}




More information about the asterisk-commits mailing list