Merge pull request #3610 from Aestek/fix/netplay-ifaddr-segfault

Fix: segfault in NetPlayServer::GetInterfaceListInternal for ifa_addr-less interfaces
This commit is contained in:
Ryan Houdek 2016-02-08 16:27:50 -05:00
commit 32dcb4c37c
1 changed files with 3 additions and 0 deletions

View File

@ -828,6 +828,9 @@ std::vector<std::pair<std::string, std::string>> NetPlayServer::GetInterfaceList
for (ifaddrs* curifp = ifp; curifp; curifp = curifp->ifa_next)
{
sockaddr* sa = curifp->ifa_addr;
if (sa == nullptr)
continue;
if (sa->sa_family != AF_INET)
continue;
sockaddr_in* sai = (struct sockaddr_in*) sa;