0
0
mirror of https://github.com/monero-project/kovri synced 2025-10-06 00:32:51 +02:00

Router ssu session: Fix potential null dereference

Address is checked in GetIntroKey so the chances of running into the new
assert are negligible. But Coverity is right, the potential is nonzero.

Silences Coverity #183014.
This commit is contained in:
Tadeas Moravec
2018-07-06 14:56:08 +02:00
parent 8c9ca2fc36
commit 5c708b84be

View File

@@ -565,6 +565,7 @@ void SSUSession::SendSessionCreated(const std::uint8_t* dh_x)
// Compute exchanged session dataset size
// TODO(anonimal): at this point, why would we allow mix-and-match IPv6 to send to IPv4 - or vice versa...
assert(address);
bool const is_IPv6 = address->host.is_v6();
std::uint16_t const data_size =
get_signed_data_size(alice_ip.size() + (is_IPv6 ? 16 : 4));