]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fixes chan_local crashs in local_fixup()
authorDavid Vossel <dvossel@digium.com>
Tue, 3 May 2011 21:27:59 +0000 (21:27 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 3 May 2011 21:27:59 +0000 (21:27 +0000)
Thanks OEJ for tracking down the issue and submitting the patch.

(closes issue #19053)
Reported by: oej
Tested by: oej

Review: https://reviewboard.asterisk.org/r/1158/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@316328 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_local.c

index 14a044f6d70256d64d41980dd0f9268add33ebb6..f8e03c90715866cb3c1580c801a8dbe78c898ad2 100644 (file)
@@ -430,7 +430,7 @@ static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
                p->chan = newchan;
 
        /* Do not let a masquerade cause a Local channel to be bridged to itself! */
-       if (!ast_check_hangup(newchan) && (p->owner->_bridge == p->chan || p->chan->_bridge == p->owner)) {
+       if (!ast_check_hangup(newchan) && ((p->owner && p->owner->_bridge == p->chan) || (p->chan && p->chan->_bridge == p->owner))) {
                ast_log(LOG_WARNING, "You can not bridge a Local channel to itself!\n");
                ao2_unlock(p);
                ast_queue_hangup(newchan);