From: Matthias Wachs Date: Mon, 13 Feb 2012 13:27:25 +0000 (+0000) Subject: fix access before null check X-Git-Tag: initial-import-from-subversion-38251~14880 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fda9ccb0ab46a50a4383a670cc65480ac978483e;p=oweals%2Fgnunet.git fix access before null check --- diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 6ee14d026..eedb9f910 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c @@ -1313,11 +1313,13 @@ tcp_plugin_get_session (void *cls, const struct IPv4TcpAddress *t4; const struct IPv6TcpAddress *t6; unsigned int is_natd = GNUNET_NO; - size_t addrlen = address->address_length; + size_t addrlen = 0; GNUNET_assert (plugin != NULL); GNUNET_assert (address != NULL); + addrlen = address->address_length; + if (addrlen == sizeof (struct IPv6TcpAddress)) { GNUNET_assert (NULL != address->address); /* make static analysis happy */