From: Matthias Wachs Date: Mon, 13 Feb 2012 16:33:24 +0000 (+0000) Subject: - fixing coverity errrors X-Git-Tag: initial-import-from-subversion-38251~14863 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=92798aff74042af1df7c5296f364b81e535fa1aa;p=oweals%2Fgnunet.git - fixing coverity errrors --- diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index b6e862aa3..f88ff3388 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -511,6 +511,10 @@ http_get_session (void *cls, GNUNET_assert (plugin != NULL); GNUNET_assert (address != NULL); + GNUNET_assert (address->address != NULL); + + ats.type = htonl (GNUNET_ATS_ARRAY_TERMINATOR); + ats.value = htonl (GNUNET_ATS_ARRAY_TERMINATOR); /* find existing session */ s = lookup_session (plugin, address); @@ -543,7 +547,7 @@ http_get_session (void *cls, s->ats_address_network_type = htonl (GNUNET_ATS_NET_UNSPECIFIED); /* Get ATS type */ - if ((addrlen == sizeof (struct IPv4HttpAddress)) && (address->address != NULL)) + if (addrlen == sizeof (struct IPv4HttpAddress)) { struct IPv4HttpAddress *a4 = (struct IPv4HttpAddress *) address->address; struct sockaddr_in s4; @@ -556,7 +560,7 @@ http_get_session (void *cls, #endif ats = plugin->env->get_address_type (plugin->env->cls, (const struct sockaddr *) &s4, sizeof (struct sockaddr_in)); } - if ((addrlen == sizeof (struct IPv6HttpAddress)) && (address->address != NULL)) + if (addrlen == sizeof (struct IPv6HttpAddress)) { struct IPv6HttpAddress *a6 = (struct IPv6HttpAddress *) address->address; struct sockaddr_in6 s6;