From dbf84c5121543754d10d04be6182da0603754e32 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 18 Jan 2024 22:23:37 +0100 Subject: fix #8105 --- src/lib/exchange_api_handle.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c index 059a4a374..4cc93f144 100644 --- a/src/lib/exchange_api_handle.c +++ b/src/lib/exchange_api_handle.c @@ -544,8 +544,8 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor, { const json_t *keys; json_t *key; - unsigned int off; - unsigned int pos; + size_t off; + size_t pos; const char *auditor_url; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("auditor_pub", @@ -637,7 +637,12 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor, auditor->denom_keys[pos].auditor_sig = auditor_sig; pos++; } - auditor->num_denom_keys = pos; + if (pos > UINT_MAX) + { + GNUNET_break (0); + return GNUNET_SYSERR; + } + auditor->num_denom_keys = (unsigned int) pos; return GNUNET_OK; } -- cgit v1.2.3