From f8644e1f1fe89c06ed80db6b4a1e66d71b9c9a13 Mon Sep 17 00:00:00 2001 From: Jim Tittsler Date: Fri, 5 Nov 2021 13:07:07 +0900 Subject: [PATCH] fix Linux AF_INET iteration segfault Prevent segfault when WireGuard is active and an interface has `ifaptr->ifa_addr == NULL` --- src/creflector.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/creflector.cpp b/src/creflector.cpp index 1f5e65b..a813df9 100644 --- a/src/creflector.cpp +++ b/src/creflector.cpp @@ -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;