summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2024-01-18 22:23:37 +0100
committerChristian Grothoff <christian@grothoff.org>2024-01-18 22:23:37 +0100
commitdbf84c5121543754d10d04be6182da0603754e32 (patch)
treecb830d629ea4b47a9a7b9cbaaaa1866e87c34de1
parentd7962e0172fcf32dde62125eac83c4c3816666da (diff)
downloadexchange-dbf84c5121543754d10d04be6182da0603754e32.tar.gz
exchange-dbf84c5121543754d10d04be6182da0603754e32.tar.bz2
exchange-dbf84c5121543754d10d04be6182da0603754e32.zip
fix #8105
-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 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;
}