aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/multicast/gnunet-service-multicast.c6
-rw-r--r--src/namecache/namecache_api.c8
2 files changed, 11 insertions, 3 deletions
diff --git a/src/multicast/gnunet-service-multicast.c b/src/multicast/gnunet-service-multicast.c
index cf7dde913..b5be257d6 100644
--- a/src/multicast/gnunet-service-multicast.c
+++ b/src/multicast/gnunet-service-multicast.c
@@ -1448,6 +1448,12 @@ check_client_member_join (void *cls,
1448 uint16_t msg_size = ntohs (msg->header.size); 1448 uint16_t msg_size = ntohs (msg->header.size);
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
1452 if (0 == relay_count}
1453 {
1454 GNUNET_break (0);
1455 return GNUNET_SYSERR;
1456 }
1451 if (UINT32_MAX / relay_count < sizeof (*relays)){ 1457 if (UINT32_MAX / relay_count < sizeof (*relays)){
1452 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 1458 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
1453 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n", 1459 "relay_count (%lu) * sizeof (*relays) (%lu) exceeds UINT32_MAX!\n",
diff --git a/src/namecache/namecache_api.c b/src/namecache/namecache_api.c
index 2bb233da1..2a60a2813 100644
--- a/src/namecache/namecache_api.c
+++ b/src/namecache/namecache_api.c
@@ -483,9 +483,11 @@ GNUNET_NAMECACHE_block_cache (struct GNUNET_NAMECACHE_Handle *h,
483 483
484 if (NULL == h->mq) 484 if (NULL == h->mq)
485 return NULL; 485 return NULL;
486 blen = ntohl (block->purpose.size) 486 blen = ntohl (block->purpose.size);
487 - sizeof (struct GNUNET_TIME_AbsoluteNBO) 487 GNUNET_assert (blen > (sizeof (struct GNUNET_TIME_AbsoluteNBO) +
488 - sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose); 488 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose)));
489 blen -= (sizeof (struct GNUNET_TIME_AbsoluteNBO) +
490 sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose));
489 rid = get_op_id (h); 491 rid = get_op_id (h);
490 qe = GNUNET_new (struct GNUNET_NAMECACHE_QueueEntry); 492 qe = GNUNET_new (struct GNUNET_NAMECACHE_QueueEntry);
491 qe->nsh = h; 493 qe->nsh = h;