exchange

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

commit 9e70917239af44b2c6bcfe66bbf3418f9069c8e2
parent c8126ffcaea1bc51fec9483b1a2383c50398fbab
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu, 18 Jan 2024 22:37:54 +0100

fix #8103

Diffstat:
Msrc/lib/exchange_api_handle.c | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c @@ -280,17 +280,22 @@ parse_fees (const struct TALER_MasterPublicKeyP *master_pub, unsigned int *fees_len) { struct TALER_EXCHANGE_WireFeesByMethod *fbm; - unsigned int fbml = json_object_size (fees); + size_t fbml = json_object_size (fees); unsigned int i = 0; const char *key; const json_t *fee_array; + if (UINT_MAX < fbml) + { + GNUNET_break (0); + return NULL; + } fbm = GNUNET_new_array (fbml, struct TALER_EXCHANGE_WireFeesByMethod); - *fees_len = fbml; + *fees_len = (unsigned int) fbml; json_object_foreach ((json_t *) fees, key, fee_array) { struct TALER_EXCHANGE_WireFeesByMethod *fe = &fbm[i++]; - unsigned int idx; + size_t idx; json_t *fee; fe->method = GNUNET_strdup (key);