Fix: segfault in NetPlayServer::GetInterfaceListInternal for ifa_addr-less interfaces

`NetPlayServer::GetInterfaceListInternal` was crashing dolphin with a segfault when encountering a
network interface without `ifa_addr`.
This commit is contained in:
Aestek 2016-02-08 21:15:48 +01:00
parent 08c9e3b7a4
commit b92a80ba1b
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;