Browse Source

Fix segfault when UPnP is enabled

Added null check.

Signed-off-by: kleenex <kleenex@i2pmail.org>
pull/1835/head
kleenex 2 years ago
parent
commit
55be5c74f0
No known key found for this signature in database
GPG Key ID: 26777867B0F5A871
  1. 4
      daemon/UPnP.cpp

4
daemon/UPnP.cpp

@ -163,7 +163,7 @@ namespace transport
if (!a) return; if (!a) return;
for (const auto& address : *a) for (const auto& address : *a)
{ {
if (!address->host.is_v6 () && address->port) if (address && !address->host.is_v6 () && address->port)
TryPortMapping (address); TryPortMapping (address);
} }
m_Timer.expires_from_now (boost::posix_time::minutes(20)); // every 20 minutes m_Timer.expires_from_now (boost::posix_time::minutes(20)); // every 20 minutes
@ -215,7 +215,7 @@ namespace transport
if (!a) return; if (!a) return;
for (const auto& address : *a) for (const auto& address : *a)
{ {
if (!address->host.is_v6 () && address->port) if (address && !address->host.is_v6 () && address->port)
CloseMapping (address); CloseMapping (address);
} }
} }

Loading…
Cancel
Save