commit e1e6c3ebcb9899661783566906f58b2596c93a84
parent a0378a4901c6bfca5dbd6cc5f396e90668abcec4
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 13 Aug 2026 20:59:40 +0200
handle round-down frequency of zero
Diffstat:
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/src/backenddb/insert_report.c b/src/backenddb/insert_report.c
@@ -65,6 +65,13 @@ TALER_MERCHANTDB_insert_report (
pg->current_merchant_id));
GNUNET_CRYPTO_random_block (&report_token,
sizeof (report_token));
+ /* GNUNET_TIME_absolute_round_down() asserts on a zero interval, which
+ would abort the process for a client-supplied frequency of 0. */
+ if (GNUNET_TIME_relative_is_zero (frequency))
+ {
+ GNUNET_break (0);
+ return GNUNET_DB_STATUS_HARD_ERROR;
+ }
start =
GNUNET_TIME_absolute_to_timestamp (
GNUNET_TIME_absolute_add (
diff --git a/src/backenddb/update_report.c b/src/backenddb/update_report.c
@@ -54,6 +54,13 @@ TALER_MERCHANTDB_update_report (
GNUNET_assert (NULL != pg->current_merchant_id);
GNUNET_assert (0 == strcmp (instance_id,
pg->current_merchant_id));
+ /* GNUNET_TIME_absolute_round_down() asserts on a zero interval, which
+ would abort the process for a client-supplied frequency of 0. */
+ if (GNUNET_TIME_relative_is_zero (frequency))
+ {
+ GNUNET_break (0);
+ return GNUNET_DB_STATUS_HARD_ERROR;
+ }
start =
GNUNET_TIME_absolute_to_timestamp (
GNUNET_TIME_absolute_add (