From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 18 Nov 2026 17:41:26 +0100 Subject: [PATCH] auditor: refuse melts with an impossible number of fresh coins The coins helper sizes stack arrays by the length of the melt's denomination serial array, which comes from the database it audits. Issue: https://bugs.taler.net/n/12215 Assisted by LLM --- src/auditor/taler-helper-auditor-coins.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c index 5782f4ea9..646d189dd 100644 --- a/src/auditor/taler-helper-auditor-coins.c +++ b/src/auditor/taler-helper-auditor-coins.c @@ -1750,6 +1750,21 @@ refresh_session_cb (struct CoinContext *cc, GNUNET_assert (rowid >= TALER_ARL_USE_PP (coins_melt_serial_id)); /* should be monotonically increasing */ TALER_ARL_USE_PP (coins_melt_serial_id) = rowid + 1; + if ( (0 == num_nds) || + (num_nds > TALER_MAX_COINS) ) + { + /* the number of fresh coins sizes arrays on the stack below */ + qs = report_row_inconsistency ("melt", + rowid, + "invalid number of fresh coins"); + if (0 > qs) + { + GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); + cc->qs = qs; + return GNUNET_SYSERR; + } + return GNUNET_OK; + } qs = TALER_ARL_get_denomination_info (old_denom_pub, &issue, &h_denom_pub); -- 2.47.3