commit 0d4387905d751819ab340a6808f98e16a76897c3
parent e1e6c3ebcb9899661783566906f58b2596c93a84
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 13 Aug 2026 21:03:50 +0200
handle time underflow without crashing
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/backend/taler-merchant-httpd_get-private-statistics-report-transactions.c b/src/backend/taler-merchant-httpd_get-private-statistics-report-transactions.c
@@ -713,6 +713,12 @@ TMH_private_get_statistics_report_transactions (
end_date.abs_time,
GNUNET_TIME_relative_multiply (rctx->period,
rctx->count)));
+ if (GNUNET_TIME_absolute_is_zero (start_date.abs_time))
+ {
+ /* Zero is special and not allowed, use 1s to avoid it
+ if the above underflows 1970-01-01... */
+ start_date.abs_time.abs_value_us = 1000LLU * 1000LLU;
+ }
root = GNUNET_JSON_PACK (
GNUNET_JSON_pack_string ("business_name",
mi->settings.name),