DEV9: Perform a null check on ifa_addr when searching adapters

This commit is contained in:
TheLastRar 2023-07-25 01:39:38 +01:00 committed by refractionpcsx2
parent fd1b1d0c24
commit d4cb35469d
1 changed files with 3 additions and 1 deletions

View File

@ -187,7 +187,9 @@ bool AdapterUtils::GetAdapter(const std::string& name, Adapter* adapter, Adapter
do
{
if (pAdapter->ifa_addr->sa_family == AF_INET && strcmp(pAdapter->ifa_name, name.c_str()) == 0)
if (pAdapter->ifa_addr != nullptr &&
pAdapter->ifa_addr->sa_family == AF_INET &&
strcmp(pAdapter->ifa_name, name.c_str()) == 0)
break;
pAdapter = pAdapter->ifa_next;