diff options
Diffstat (limited to 'src/multicast/gnunet-service-multicast.c')
-rw-r--r-- | src/multicast/gnunet-service-multicast.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c index 20d29b906..f8441cc2b 100644 --- a/src/multicast/gnunet-service-multicast.c +++ b/src/multicast/gnunet-service-multicast.c | |||
@@ -1449,17 +1449,15 @@ check_client_member_join (void *cls, | |||
1449 | struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1]; | 1449 | struct GNUNET_PeerIdentity *relays = (struct GNUNET_PeerIdentity *) &msg[1]; |
1450 | uint32_t relay_count = ntohl (msg->relay_count); | 1450 | uint32_t relay_count = ntohl (msg->relay_count); |
1451 | 1451 | ||
1452 | if (0 == relay_count) | 1452 | if (0 != relay_count) |
1453 | { | 1453 | { |
1454 | GNUNET_break (0); | 1454 | if (UINT32_MAX / relay_count < sizeof (*relays)){ |
1455 | return GNUNET_SYSERR; | 1455 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
1456 | } | 1456 | "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", |
1457 | if (UINT32_MAX / relay_count < sizeof (*relays)){ | 1457 | (unsigned long)relay_count, |
1458 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 1458 | sizeof (*relays)); |
1459 | "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", | 1459 | return GNUNET_SYSERR; |
1460 | (unsigned long)relay_count, | 1460 | } |
1461 | sizeof (*relays)); | ||
1462 | return GNUNET_SYSERR; | ||
1463 | } | 1461 | } |
1464 | uint32_t relay_size = relay_count * sizeof (*relays); | 1462 | uint32_t relay_size = relay_count * sizeof (*relays); |
1465 | struct GNUNET_MessageHeader *join_msg = NULL; | 1463 | struct GNUNET_MessageHeader *join_msg = NULL; |