summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2022-03-12 23:39:22 +0100
committerChristian Grothoff <grothoff@gnunet.org>2022-03-12 23:39:22 +0100
commit28bfcbd6364765feaba442c28e0be413607e9afb (patch)
treecfde08e7576c97a86cc021f14ae2a40de3cc0398
parent11b80a8098a5a83041fc03accd98a8d52f2e1f30 (diff)
-add sanity check on local inputs, fix assertion
-rw-r--r--src/dht/gnunet-service-dht_clients.c9
-rw-r--r--src/dht/plugin_block_dht.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/src/dht/gnunet-service-dht_clients.c b/src/dht/gnunet-service-dht_clients.c
index c50406ada..6a4f58d1f 100644
--- a/src/dht/gnunet-service-dht_clients.c
+++ b/src/dht/gnunet-service-dht_clients.c
@@ -510,6 +510,15 @@ handle_dht_local_put (void *cls,
(unsigned long) (size - sizeof(struct GNUNET_DHT_ClientPutMessage)),
GNUNET_h2s (&dht_msg->key),
(unsigned int) bd.type);
+ if (GNUNET_OK !=
+ GNUNET_BLOCK_check_block (GDS_block_context,
+ bd.type,
+ bd.data,
+ bd.data_size))
+ {
+ GNUNET_break (0);
+ return;
+ }
GNUNET_STATISTICS_update (GDS_stats,
"# PUT requests received from clients",
1,
diff --git a/src/dht/plugin_block_dht.c b/src/dht/plugin_block_dht.c
index 5b6841a98..3dd3dd792 100644
--- a/src/dht/plugin_block_dht.c
+++ b/src/dht/plugin_block_dht.c
@@ -240,7 +240,7 @@ block_plugin_dht_check_reply (
GNUNET_assert (reply_block_size >= sizeof(struct GNUNET_MessageHeader));
GNUNET_assert (reply_block_size == ntohs (msg->size));
- GNUNET_assert (GNUNET_OK !=
+ GNUNET_assert (GNUNET_OK ==
GNUNET_HELLO_get_id (hello,
&pid));
GNUNET_CRYPTO_hash (&pid,