multicast hotfix: relay_count is coerced from ul to us
authorpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>
Mon, 12 Feb 2018 01:26:25 +0000 (01:26 +0000)
committerpsyc://loupsycedyglgamf.onion/~lynX <ircs://psyced.org/youbroketheinternet>
Mon, 12 Feb 2018 01:26:25 +0000 (01:26 +0000)
src/multicast/gnunet-service-multicast.c
src/multicast/multicast.h

index d01227e2c9675ea82f92a887916be56ddd77431f..ab7d1c5a06f6013a13ecdd8143d169808f324bf9 100644 (file)
@@ -1450,6 +1450,7 @@ check_client_member_join (void *cls,
   uint16_t msg_size = ntohs (msg->header.size);
   struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1];
   uint32_t relay_count = ntohl (msg->relay_count);
+  if (relay_count > MAX_RELAY_COUNT) return GNUNET_SYSERR;
   uint16_t relay_size = relay_count * sizeof (*relays);
   struct GNUNET_MessageHeader *join_msg = NULL;
   uint16_t join_msg_size = 0;
index aeb3c0b41426998f15776a1ccfe35be22c6d972b..8ff6af237f63b5f143e946b3e839d5aa0e904f2e 100644 (file)
 #include "platform.h"
 #include "gnunet_multicast_service.h"
 
+/* FIXME: What is a reasonable value here?
+ * Should it be in an include file that clients can also see?
+ */
+#define MAX_RELAY_COUNT 123
+
 GNUNET_NETWORK_STRUCT_BEGIN