[asterisk-commits] rmudgett: trunk r407767 - in /trunk: ./ channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 7 14:52:43 CST 2014


Author: rmudgett
Date: Fri Feb  7 14:52:40 2014
New Revision: 407767

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=407767
Log:
chan_iax2: Add some more iaxs[] NULL checks to a routine already full of them.
........

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

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

Merged revisions 407766 from http://svn.asterisk.org/svn/asterisk/branches/12

Modified:
    trunk/   (props changed)
    trunk/channels/chan_iax2.c

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

Modified: trunk/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=407767&r1=407766&r2=407767
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Fri Feb  7 14:52:40 2014
@@ -11702,8 +11702,10 @@
 		fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | ntohs(mh->ts);
 		/* FIXME? Surely right here would be the right place to undo timestamp wraparound? */
 	}
+
 	/* Don't pass any packets until we're started */
-	if (!ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
+	if (!iaxs[fr->callno]
+		|| !ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
 		ast_variables_destroy(ies.vars);
 		ast_mutex_unlock(&iaxsl[fr->callno]);
 		return 1;
@@ -11720,7 +11722,8 @@
 		}
 		if (f.subclass.integer == AST_CONTROL_CONNECTED_LINE
 			|| f.subclass.integer == AST_CONTROL_REDIRECTING) {
-			if (!ast_test_flag64(iaxs[fr->callno], IAX_RECVCONNECTEDLINE)) {
+			if (iaxs[fr->callno]
+				&& !ast_test_flag64(iaxs[fr->callno], IAX_RECVCONNECTEDLINE)) {
 				/* We are not configured to allow receiving these updates. */
 				ast_debug(2, "Callno %u: Config blocked receiving control frame %d.\n",
 					fr->callno, f.subclass.integer);
@@ -11742,7 +11745,8 @@
 	}
 
 	if (f.frametype == AST_FRAME_CONTROL
-		&& f.subclass.integer == AST_CONTROL_CONNECTED_LINE) {
+		&& f.subclass.integer == AST_CONTROL_CONNECTED_LINE
+		&& iaxs[fr->callno]) {
 		struct ast_party_connected_line connected;
 
 		/*
@@ -11798,9 +11802,11 @@
 		fr->outoforder = -1;
 	}
 	fr->cacheable = ((f.frametype == AST_FRAME_VOICE) || (f.frametype == AST_FRAME_VIDEO));
-	duped_fr = iaxfrdup2(fr);
-	if (duped_fr) {
-		schedule_delivery(duped_fr, updatehistory, 0, &fr->ts);
+	if (iaxs[fr->callno]) {
+		duped_fr = iaxfrdup2(fr);
+		if (duped_fr) {
+			schedule_delivery(duped_fr, updatehistory, 0, &fr->ts);
+		}
 	}
 	if (iaxs[fr->callno] && iaxs[fr->callno]->last < fr->ts) {
 		iaxs[fr->callno]->last = fr->ts;




More information about the asterisk-commits mailing list