exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 03019f206254e3c42e97042b500c380e54d90ed1
parent b246a564f5a3de84d3ae9980a737db73c34ab4bc
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Fri, 14 Aug 2026 22:43:24 +0200

do not assert against amount overflow on untrusted input

Diffstat:
Msrc/lib/exchange_api_get-reserves-RESERVE_PUB-history.c | 21+++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/src/lib/exchange_api_get-reserves-RESERVE_PUB-history.c b/src/lib/exchange_api_get-reserves-RESERVE_PUB-history.c @@ -360,14 +360,19 @@ parse_withdraw (struct TALER_EXCHANGE_ReserveHistoryEntry *rh, GNUNET_JSON_parse_free (withdraw_spec); return GNUNET_SYSERR; } - GNUNET_assert (0 <= - TALER_amount_add (&fee_acc, - &fee_acc, - &dki->fees.withdraw)); - GNUNET_assert (0 <= - TALER_amount_add (&amount_acc, - &amount_acc, - &dki->value)); + if ( (0 > + TALER_amount_add (&fee_acc, + &fee_acc, + &dki->fees.withdraw)) || + (0 > + TALER_amount_add (&amount_acc, + &amount_acc, + &dki->value)) ) + { + GNUNET_break_op (0); + GNUNET_JSON_parse_free (withdraw_spec); + return GNUNET_SYSERR; + } } if ( (GNUNET_YES !=