diff options
author | lurchi <lurchi@strangeplace.net> | 2018-06-24 23:34:16 +0200 |
---|---|---|
committer | lurchi <lurchi@strangeplace.net> | 2018-06-24 23:34:41 +0200 |
commit | ba2ff9fed637ed464860afac6a4e49d94aebc84d (patch) | |
tree | 4b17e4d5bf4b32269b391a4d98ca74cda3234b8d | |
parent | c38455c65f9968ccf7e870c3cce30fa19f319376 (diff) | |
parent | 99f858c66be3206f5660c9d031cd6e6345a1267d (diff) | |
download | gnunet-ba2ff9fed637ed464860afac6a4e49d94aebc84d.tar.gz gnunet-ba2ff9fed637ed464860afac6a4e49d94aebc84d.zip |
Merge branch 'master' of ssh://gnunet.org/gnunet
-rw-r--r-- | src/multicast/gnunet-service-multicast.c | 6 | ||||
-rw-r--r-- | src/namecache/namecache_api.c | 8 |
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; |