summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-03-29 10:11:15 +0200
committerMartin Schanzenbach <schanzen@gnunet.org>2022-03-29 10:11:15 +0200
commita9b18aa64cc03978ac410bd2cb99133040f0b188 (patch)
tree19e5f2e773b5e58f209544fc4244d01ba5ac520f
parent51bb2c989c5553b0b7963426e964ecf85d49de7d (diff)
GNS: Do not fail on assertions in block processing
-rw-r--r--src/gns/plugin_block_gns.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gns/plugin_block_gns.c b/src/gns/plugin_block_gns.c
index aad1f1583..2d61f6395 100644
--- a/src/gns/plugin_block_gns.c
+++ b/src/gns/plugin_block_gns.c
@@ -242,8 +242,14 @@ block_plugin_gns_check_reply (void *cls,
GNUNET_break (0);
return GNUNET_BLOCK_REPLY_TYPE_NOT_SUPPORTED;
}
- GNUNET_assert (reply_block_size >= sizeof(struct GNUNET_GNSRECORD_Block));
- GNUNET_assert (GNUNET_GNSRECORD_block_get_size (block) < reply_block_size);
+ if (reply_block_size < sizeof(struct GNUNET_GNSRECORD_Block)) {
+ GNUNET_break_op (0);
+ return GNUNET_BLOCK_REPLY_TYPE_NOT_SUPPORTED;
+ }
+ if (GNUNET_GNSRECORD_block_get_size (block) > reply_block_size) {
+ GNUNET_break_op (0);
+ return GNUNET_BLOCK_REPLY_TYPE_NOT_SUPPORTED;
+ }
GNUNET_CRYPTO_hash (reply_block,
reply_block_size,
&chash);