- fixed 2128: Blacklisting makes transport service crash
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 1 Feb 2012 09:13:19 +0000 (09:13 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 1 Feb 2012 09:13:19 +0000 (09:13 +0000)
src/transport/gnunet-service-transport_blacklist.c

index 6bd1caa50b59ad76a73c4ee7a8ba987027e3fa91..fc7a5cec33baedfd030f223c3fee94254bdfb7ed 100644 (file)
@@ -722,9 +722,11 @@ test_blacklisted (void *cls, const GNUNET_HashCode * key, void *value)
   const char *transport_name = cls;
   char *be = value;
 
-  GNUNET_assert (transport_name != NULL);
-  GNUNET_assert (be != NULL);
+  /* blacklist check for specific no specific transport*/
+  if (transport_name == NULL)
+    return GNUNET_NO;
 
+  /* blacklist check for specific transport */
   if (0 == strcmp (transport_name, be))
     return GNUNET_NO;           /* abort iteration! */
   return GNUNET_OK;
@@ -748,6 +750,8 @@ GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer,
 {
   struct GST_BlacklistCheck *bc;
 
+  GNUNET_assert (peer != NULL);
+
   if ((blacklist != NULL) &&
       (GNUNET_SYSERR ==
        GNUNET_CONTAINER_multihashmap_get_multiple (blacklist, &peer->hashPubKey,