aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-18 22:37:54 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-18 22:37:54 +0100
commit9e70917239af44b2c6bcfe66bbf3418f9069c8e2 (patch)
treecf5bd1b638fde26174ca8981f5ff1ab3a638247f
parentc8126ffcaea1bc51fec9483b1a2383c50398fbab (diff)
downloadexchange-9e70917239af44b2c6bcfe66bbf3418f9069c8e2.tar.xz
fix #8103
-rw-r--r--src/lib/exchange_api_handle.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 4d1dacbb8..a09020579 100644
--- 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);