From fda9ccb0ab46a50a4383a670cc65480ac978483e Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Mon, 13 Feb 2012 13:27:25 +0000 Subject: [PATCH] fix access before null check --- src/transport/plugin_transport_tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 */ -- 2.25.1