diff options
author | thilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-04-21 13:34:44 +0000 |
---|---|---|
committer | thilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2008-04-21 13:34:44 +0000 |
commit | fa959d0cb046a9d9bdbd538563df2b64fd41fd94 (patch) | |
tree | 1973dc5107d1ae12460213368c1642133c31fa39 /code/qcommon | |
parent | a3a9257fe11212f3e8dab01e63a7441b74519e5f (diff) | |
download | ioquake3-aero-fa959d0cb046a9d9bdbd538563df2b64fd41fd94.tar.gz ioquake3-aero-fa959d0cb046a9d9bdbd538563df2b64fd41fd94.zip |
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
Diffstat (limited to 'code/qcommon')
-rw-r--r-- | code/qcommon/net_ip.c | 8 |
1 files changed, 7 insertions, 1 deletions
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) { |