[asterisk-commits] russell: branch 1.2 r94255 - /branches/1.2/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Dec 20 14:21:41 CST 2007


Author: russell
Date: Thu Dec 20 14:21:41 2007
New Revision: 94255

URL: http://svn.digium.com/view/asterisk?view=rev&rev=94255
Log:
Fix another potential seg fault ...

(closes issue #11606)
Reported by: dimas

Modified:
    branches/1.2/channels/chan_iax2.c

Modified: branches/1.2/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_iax2.c?view=diff&rev=94255&r1=94254&r2=94255
==============================================================================
--- branches/1.2/channels/chan_iax2.c (original)
+++ branches/1.2/channels/chan_iax2.c Thu Dec 20 14:21:41 2007
@@ -2620,7 +2620,7 @@
 
 static struct iax2_peer *realtime_peer(const char *peername, struct sockaddr_in *sin)
 {
-	struct ast_variable *var;
+	struct ast_variable *var = NULL;
 	struct ast_variable *tmp;
 	struct iax2_peer *peer=NULL;
 	time_t regseconds, nowtime;
@@ -2654,7 +2654,7 @@
 		 * is because we only have the IP address and the host field might be
 		 * set as a name (and the reverse PTR might not match).
 		 */
-		if (var) {
+		if (var && sin) {
 			for (tmp = var; tmp; tmp = tmp->next) {
 				if (!strcasecmp(tmp->name, "host")) {
 					struct in_addr sin2 = { 0, };




More information about the asterisk-commits mailing list