gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r21226 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r21226 - gnunet/src/transport
Date: Wed, 2 May 2012 17:38:17 +0200

Author: wachs
Date: 2012-05-02 17:38:17 +0200 (Wed, 02 May 2012)
New Revision: 21226

Modified:
   gnunet/src/transport/plugin_transport_http.c
Log:
- fix


Modified: gnunet/src/transport/plugin_transport_http.c
===================================================================
--- gnunet/src/transport/plugin_transport_http.c        2012-05-02 13:30:58 UTC 
(rev 21225)
+++ gnunet/src/transport/plugin_transport_http.c        2012-05-02 15:38:17 UTC 
(rev 21226)
@@ -350,9 +350,25 @@
   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 @@
   }
   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;
   }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]