aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_handle.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-07-20 02:15:58 +0200
committerChristian Grothoff <christian@grothoff.org>2023-07-20 02:15:58 +0200
commit59e057b93e65c73dc3cd57dcced563847d85ba77 (patch)
tree84677266a32fc0ff25d51f694e9de83aaa55106e /src/lib/exchange_api_handle.c
parent50c0cc489d9a9a2a82b643ae09eb78af9e599db6 (diff)
downloadexchange-59e057b93e65c73dc3cd57dcced563847d85ba77.tar.xz
-misc fixes
Diffstat (limited to 'src/lib/exchange_api_handle.c')
-rw-r--r--src/lib/exchange_api_handle.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c
index 0ad2f7a34..016f7bf6b 100644
--- a/src/lib/exchange_api_handle.c
+++ b/src/lib/exchange_api_handle.c
@@ -422,6 +422,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
const json_t *keys;
json_t *key;
unsigned int off;
+ unsigned int pos;
const char *auditor_url;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("auditor_pub",
@@ -450,7 +451,7 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
auditor->denom_keys
= GNUNET_new_array (json_array_size (keys),
struct TALER_EXCHANGE_AuditorDenominationInfo);
-
+ pos = 0;
json_array_foreach (keys, off, key) {
struct TALER_AuditorSignatureP auditor_sig;
struct TALER_DenominationHashP denom_h;
@@ -509,10 +510,11 @@ parse_json_auditor (struct TALER_EXCHANGE_AuditorInformation *auditor,
return GNUNET_SYSERR;
}
}
- auditor->denom_keys[off].denom_key_offset = dk_off;
- auditor->denom_keys[off].auditor_sig = auditor_sig;
+ auditor->denom_keys[pos].denom_key_offset = dk_off;
+ auditor->denom_keys[pos].auditor_sig = auditor_sig;
+ pos++;
}
- auditor->num_denom_keys = off;
+ auditor->num_denom_keys = pos;
return GNUNET_OK;
}
@@ -2042,6 +2044,7 @@ TALER_EXCHANGE_keys_to_json (const struct TALER_EXCHANGE_Keys *kd)
&kd->denom_keys[adi->denom_key_offset];
json_t *k;
+ GNUNET_assert (adi->denom_key_offset < kd->num_denom_keys);
if (GNUNET_TIME_timestamp_cmp (now,
>,
dk->expire_deposit))