[asterisk-commits] mmichelson: branch 1.4 r169210 - /branches/1.4/channels/chan_local.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jan 19 09:52:15 CST 2009


Author: mmichelson
Date: Mon Jan 19 09:52:15 2009
New Revision: 169210

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=169210
Log:
Prevent a crash in chan_local due to a potential NULL pointer dereference

Move the check for if both channels on a local_pvt have generators to below
where p->chan is checked for NULLity (NULLness?). This prevents a crash from
occurring if p->chan is NULL.

(closes issue #14189)
Reported by: sascha
Patches:
      14189.patch uploaded by putnopvut (license 60)
Tested by: sascha


Modified:
    branches/1.4/channels/chan_local.c

Modified: branches/1.4/channels/chan_local.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/channels/chan_local.c?view=diff&rev=169210&r1=169209&r2=169210
==============================================================================
--- branches/1.4/channels/chan_local.c (original)
+++ branches/1.4/channels/chan_local.c Mon Jan 19 09:52:15 2009
@@ -168,10 +168,6 @@
 	/* Recalculate outbound channel */
 	other = isoutbound ? p->owner : p->chan;
 
-	/* do not queue frame if generator is on both local channels */
-	if (us && us->generator && other->generator)
-		return 0;
-
 	/* Set glare detection */
 	ast_set_flag(p, LOCAL_GLARE_DETECT);
 	if (ast_test_flag(p, LOCAL_CANCEL_QUEUE)) {
@@ -185,6 +181,10 @@
 		ast_clear_flag(p, LOCAL_GLARE_DETECT);
 		return 0;
 	}
+
+	/* do not queue frame if generator is on both local channels */
+	if (us && us->generator && other->generator)
+		return 0;
 
 	/* Ensure that we have both channels locked */
 	while (other && ast_channel_trylock(other)) {




More information about the asterisk-commits mailing list