From fa959d0cb046a9d9bdbd538563df2b64fd41fd94 Mon Sep 17 00:00:00 2001 From: thilo Date: Mon, 21 Apr 2008 13:34:44 +0000 Subject: Fix crash bug for interfaces without assigned address, thanks to PhoinixGR for reporting. git-svn-id: svn://svn.icculus.org/quake3/trunk@1324 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/net_ip.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'code/qcommon') diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c index d7a883a..862f91a 100644 --- a/code/qcommon/net_ip.c +++ b/code/qcommon/net_ip.c @@ -1194,7 +1194,13 @@ NET_GetLocalAddress 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) { -- cgit v1.2.3