From f9ed0d4aa236ce8beac45c08084345e0b1af2fbb Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 26 Apr 2022 20:01:32 -0400 Subject: [PATCH] fixed crash --- libi2pd/RouterInfo.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libi2pd/RouterInfo.cpp b/libi2pd/RouterInfo.cpp index 87120bdd..6a6f2c6c 100644 --- a/libi2pd/RouterInfo.cpp +++ b/libi2pd/RouterInfo.cpp @@ -682,6 +682,8 @@ namespace data addr->transportStyle = eTransportSSU2; addr->caps = caps; addr->date = 0; + addr->ssu.reset (new SSUExt ()); + addr->ssu->mtu = 0; memcpy (addr->s, staticKey, 32); memcpy (addr->i, introKey, 32); if (addr->IsV4 ()) m_SupportedTransports |= eSSU2V4; @@ -699,6 +701,8 @@ namespace data addr->published = true; addr->caps = 0; addr->date = 0; + addr->ssu.reset (new SSUExt ()); + addr->ssu->mtu = 0; memcpy (addr->s, staticKey, 32); memcpy (addr->i, introKey, 32); if (addr->IsV4 ()) @@ -1246,7 +1250,7 @@ namespace data if (address.transportStyle == eTransportSSU || address.IsSSU2 ()) { // write introducers if any - if (!address.ssu->introducers.empty()) + if (address.ssu && !address.ssu->introducers.empty()) { int i = 0; for (const auto& introducer: address.ssu->introducers) @@ -1324,7 +1328,7 @@ namespace data if (address.transportStyle == eTransportSSU || address.IsSSU2 ()) { // write mtu - if (address.ssu->mtu) + if (address.ssu && address.ssu->mtu) { WriteString ("mtu", properties); properties << '=';