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

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Mar 31 12:14:32 MST 2006


Author: russell
Date: Fri Mar 31 13:14:28 2006
New Revision: 16772

URL: http://svn.digium.com/view/asterisk?rev=16772&view=rev
Log:
move a NULL check to before the first time the pointer is dereferenced (issue #6832)

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

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-blocked' - no diff available.

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=16772&r1=16771&r2=16772&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Fri Mar 31 13:14:28 2006
@@ -1611,6 +1611,8 @@
 	int callno = f->callno;
 	
 	/* Called with iaxsl held */
+	if (!iaxs[callno])
+		return -1;
 	if (option_debug > 2 && iaxdebug)
 		ast_log(LOG_DEBUG, "Sending %d on %d/%d to %s:%d\n", f->ts, callno, iaxs[callno]->peercallno, ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[callno]->addr.sin_addr), ntohs(iaxs[callno]->addr.sin_port));
 	/* Don't send if there was an error, but return error instead */
@@ -1618,8 +1620,6 @@
 		ast_log(LOG_WARNING, "Call number = %d\n", callno);
 		return -1;
 	}
-	if (!iaxs[callno])
-		return -1;
 	if (iaxs[callno]->error)
 		return -1;
 	if (f->transfer) {



More information about the asterisk-commits mailing list