From 55be5c74f0c37f7a064eb4cd542bb02ee7e5333a Mon Sep 17 00:00:00 2001 From: kleenex Date: Wed, 4 Jan 2023 22:41:54 +0900 Subject: [PATCH] Fix segfault when UPnP is enabled Added null check. Signed-off-by: kleenex --- daemon/UPnP.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/UPnP.cpp b/daemon/UPnP.cpp index b7182055..dbaf864a 100644 --- a/daemon/UPnP.cpp +++ b/daemon/UPnP.cpp @@ -163,7 +163,7 @@ namespace transport if (!a) return; for (const auto& address : *a) { - if (!address->host.is_v6 () && address->port) + if (address && !address->host.is_v6 () && address->port) TryPortMapping (address); } m_Timer.expires_from_now (boost::posix_time::minutes(20)); // every 20 minutes @@ -215,7 +215,7 @@ namespace transport if (!a) return; for (const auto& address : *a) { - if (!address->host.is_v6 () && address->port) + if (address && !address->host.is_v6 () && address->port) CloseMapping (address); } }