fix wrong condition
authorxrs <xrs@mail36.net>
Wed, 4 Jul 2018 18:04:52 +0000 (20:04 +0200)
committerxrs <xrs@mail36.net>
Wed, 4 Jul 2018 18:04:52 +0000 (20:04 +0200)
src/multicast/gnunet-service-multicast.c

index 20d29b906fdb74dc8aff6b5dd6252b0d988cda27..f8441cc2b52c8f8ea04d2386f0bea7158a58b92c 100644 (file)
@@ -1449,17 +1449,15 @@ check_client_member_join (void *cls,
   struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1];
   uint32_t relay_count = ntohl (msg->relay_count);
 
-  if (0 == relay_count)
+  if (0 != relay_count)
   {
-    GNUNET_break (0);
-    return GNUNET_SYSERR;
-  }
-  if (UINT32_MAX / relay_count < sizeof (*relays)){
-      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
-                    "relay_count (%lu) * sizeof (*relays)  (%lu) exceeds UINT32_MAX!\n",
-              (unsigned long)relay_count,
-              sizeof (*relays));
-      return GNUNET_SYSERR;
+    if (UINT32_MAX / relay_count < sizeof (*relays)){
+        GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                      "relay_count (%lu) * sizeof (*relays)  (%lu) exceeds UINT32_MAX!\n",
+                (unsigned long)relay_count,
+                sizeof (*relays));
+        return GNUNET_SYSERR;
+    }
   }
   uint32_t relay_size = relay_count * sizeof (*relays);
   struct GNUNET_MessageHeader *join_msg = NULL;