r1324 - trunk/code/qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Apr 21 09:34:44 EDT 2008


Author: thilo
Date: 2008-04-21 09:34:44 -0400 (Mon, 21 Apr 2008)
New Revision: 1324

Modified:
   trunk/code/qcommon/net_ip.c
Log:
Fix crash bug for interfaces without assigned address, thanks to PhoinixGR for reporting.


Modified: trunk/code/qcommon/net_ip.c
===================================================================
--- trunk/code/qcommon/net_ip.c	2008-04-16 20:57:08 UTC (rev 1323)
+++ trunk/code/qcommon/net_ip.c	2008-04-21 13:34:44 UTC (rev 1324)
@@ -1194,7 +1194,13 @@
 void NET_AddLocalAddress(char *ifname, struct sockaddr *addr, struct sockaddr *netmask)
 {
 	int addrlen;
-	sa_family_t family = addr->sa_family;
+	sa_family_t family;
+	
+	// only add addresses that have all required info.
+	if(!addr || !netmask || !ifname)
+		return;
+	
+	family = addr->sa_family;
 
 	if(numIP < MAX_IPS)
 	{




More information about the quake3-commits mailing list