[asterisk-commits] twilson: branch 1.6.2 r288500 - in /branches/1.6.2: ./ channels/chan_local.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 22 18:10:15 CDT 2010


Author: twilson
Date: Wed Sep 22 18:10:09 2010
New Revision: 288500

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=288500
Log:
Merged revisions 288499 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r288499 | twilson | 2010-09-22 16:00:30 -0700 (Wed, 22 Sep 2010) | 8 lines
  
  Don't let a Local channel get bridged to itself
  
  If a local channel gets bridged to itself, it becomes orphaned with no devices
  left to actually tell it to hang up. This patch modifies local_fixup() to detect
  this case and deny it.
  
  Review: https://reviewboard.asterisk.org/r/934
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/channels/chan_local.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: branches/1.6.2/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_local.c?view=diff&rev=288500&r1=288499&r2=288500
==============================================================================
--- branches/1.6.2/channels/chan_local.c (original)
+++ branches/1.6.2/channels/chan_local.c Wed Sep 22 18:10:09 2010
@@ -531,6 +531,15 @@
 		p->owner = newchan;
 	else
 		p->chan = newchan;
+
+	/* Do not let a masquerade cause a Local channel to be bridged to itself! */
+	if (p->owner->_bridge == p->chan || p->chan->_bridge == p->owner) {
+		ast_log(LOG_WARNING, "You can not bridge a Local channel to itself!\n");
+		ast_mutex_unlock(&p->lock);
+		ast_queue_hangup(newchan);
+		return -1;
+	}
+
 	ast_mutex_unlock(&p->lock);
 	return 0;
 }




More information about the asterisk-commits mailing list