mirror of
https://github.com/LX3JL/xlxd.git
synced 2025-12-06 07:42:01 +01:00
fix Linux AF_INET iteration segfault
Prevent segfault when WireGuard is active and an interface has `ifaptr->ifa_addr == NULL`
This commit is contained in:
parent
2a67aa7138
commit
f8644e1f1f
|
|
@ -790,7 +790,7 @@ bool CReflector::UpdateListenMac(void)
|
|||
for ( ifaptr = ifap; (ifaptr != NULL) && !found; ifaptr = (ifaptr)->ifa_next )
|
||||
{
|
||||
// is it an AF_INET?
|
||||
if ( ifaptr->ifa_addr->sa_family == AF_INET )
|
||||
if ( ifaptr->ifa_addr && ifaptr->ifa_addr->sa_family == AF_INET )
|
||||
{
|
||||
if (ifaptr->ifa_addr == NULL)
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue