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:
parent
08c9e3b7a4
commit
b92a80ba1b
|
@ -828,6 +828,9 @@ std::vector<std::pair<std::string, std::string>> NetPlayServer::GetInterfaceList
|
||||||
for (ifaddrs* curifp = ifp; curifp; curifp = curifp->ifa_next)
|
for (ifaddrs* curifp = ifp; curifp; curifp = curifp->ifa_next)
|
||||||
{
|
{
|
||||||
sockaddr* sa = curifp->ifa_addr;
|
sockaddr* sa = curifp->ifa_addr;
|
||||||
|
|
||||||
|
if (sa == nullptr)
|
||||||
|
continue;
|
||||||
if (sa->sa_family != AF_INET)
|
if (sa->sa_family != AF_INET)
|
||||||
continue;
|
continue;
|
||||||
sockaddr_in* sai = (struct sockaddr_in*) sa;
|
sockaddr_in* sai = (struct sockaddr_in*) sa;
|
||||||
|
|
Loading…
Reference in New Issue