commit fac59c52785166518f2cf286f59f1e698f3f5ee4
parent 361fbdfcbe4101e35ba0e7d2934207fbdfcd2982
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Mon, 17 Aug 2026 17:17:41 +0200
reject shard size of 0
Diffstat:
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/exchange/taler-exchange-transfer.c b/src/exchange/taler-exchange-transfer.c
@@ -863,6 +863,14 @@ run (void *cls,
(void) cfgfile;
cfg = c;
+ if (0 == shard_size)
+ {
+ /* Would make #select_shard() create zero-width shards forever. */
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Shard size (-S) must be positive\n");
+ global_ret = EXIT_INVALIDARGUMENT;
+ return;
+ }
if (GNUNET_OK != parse_transfer_config ())
{
cfg = NULL;
diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c
@@ -1022,6 +1022,16 @@ run (void *cls,
cfg = c;
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
cls);
+ if (0 == shard_size)
+ {
+ /* Would give us empty shards, and thus fail the assertion in
+ #continue_with_shard(). */
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Shard size (-S) must be positive\n");
+ global_ret = EXIT_INVALIDARGUMENT;
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
if (GNUNET_OK !=
exchange_serve_process_config ())
{