From 78bda4c51a6c27a7656273831e7c1bdbdfe0aad7 Mon Sep 17 00:00:00 2001 From: Matthias Wachs Date: Wed, 2 May 2012 15:38:17 +0000 Subject: [PATCH] - fix --- src/transport/plugin_transport_http.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 1078b541a..48db6a372 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c @@ -350,8 +350,24 @@ int http_string_to_address (void *cls, struct sockaddr_in6 addr_6; struct IPv4HttpAddress * http_4addr; struct IPv6HttpAddress * http_6addr; - if ((addr == NULL) || (addrlen == 0) || (buf == NULL)) + + if ((NULL == addr) || (addrlen == 0)) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + + if ('\0' != addr[addrlen - 1]) + { + GNUNET_break (0); return GNUNET_SYSERR; + } + + if (strlen (addr) != addrlen - 1) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } /* protocoll + "://" + ":" */ if (addrlen <= (strlen (protocol) + 4)) @@ -396,9 +412,9 @@ int http_string_to_address (void *cls, } else { - GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Invalid address string `%s' to convert to address\n", - addr); + addr_str); GNUNET_break (0); return GNUNET_SYSERR; } -- 2.25.1