aboutsummaryrefslogtreecommitdiff
path: root/src/transport/plugin_transport_http.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2012-05-02 15:38:17 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2012-05-02 15:38:17 +0000
commit78bda4c51a6c27a7656273831e7c1bdbdfe0aad7 (patch)
tree0165c9d1535fb0838fd24e9fcaafce074be11636 /src/transport/plugin_transport_http.c
parent04211f65378f99067dd648630393ca7f3723be87 (diff)
downloadgnunet-78bda4c51a6c27a7656273831e7c1bdbdfe0aad7.tar.gz
gnunet-78bda4c51a6c27a7656273831e7c1bdbdfe0aad7.zip
- fix
Diffstat (limited to 'src/transport/plugin_transport_http.c')
-rw-r--r--src/transport/plugin_transport_http.c22
1 files 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,
350 struct sockaddr_in6 addr_6; 350 struct sockaddr_in6 addr_6;
351 struct IPv4HttpAddress * http_4addr; 351 struct IPv4HttpAddress * http_4addr;
352 struct IPv6HttpAddress * http_6addr; 352 struct IPv6HttpAddress * http_6addr;
353 if ((addr == NULL) || (addrlen == 0) || (buf == NULL)) 353
354 if ((NULL == addr) || (addrlen == 0))
355 {
356 GNUNET_break (0);
357 return GNUNET_SYSERR;
358 }
359
360 if ('\0' != addr[addrlen - 1])
361 {
362 GNUNET_break (0);
354 return GNUNET_SYSERR; 363 return GNUNET_SYSERR;
364 }
365
366 if (strlen (addr) != addrlen - 1)
367 {
368 GNUNET_break (0);
369 return GNUNET_SYSERR;
370 }
355 371
356 /* protocoll + "://" + ":" */ 372 /* protocoll + "://" + ":" */
357 if (addrlen <= (strlen (protocol) + 4)) 373 if (addrlen <= (strlen (protocol) + 4))
@@ -396,9 +412,9 @@ int http_string_to_address (void *cls,
396 } 412 }
397 else 413 else
398 { 414 {
399 GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, 415 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
400 "Invalid address string `%s' to convert to address\n", 416 "Invalid address string `%s' to convert to address\n",
401 addr); 417 addr_str);
402 GNUNET_break (0); 418 GNUNET_break (0);
403 return GNUNET_SYSERR; 419 return GNUNET_SYSERR;
404 } 420 }