commit a677f34d3be0b4202b622bbef999bb220d3bc760
parent 4ea88f9072e429b9c653b92c4196a6d899129a2b
Author: Christian Grothoff <christian@grothoff.org>
Date: Mon, 12 Oct 2026 23:56:57 +0200
handle NULL cases
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/lib/exchange_api_post-reserves-RESERVE_PUB-purse.c b/src/lib/exchange_api_post-reserves-RESERVE_PUB-purse.c
@@ -467,6 +467,16 @@ TALER_EXCHANGE_post_reserves_purse_create (
payto_uri = TALER_reserve_make_payto (url,
&prph->reserve_pub);
+ if (NULL == payto_uri.normalized_payto)
+ {
+ GNUNET_break (0);
+ TALER_EXCHANGE_keys_decref (prph->keys);
+ json_decref (prph->contract_terms);
+ GNUNET_free (prph->base_url);
+ GNUNET_free (prph->exchange_url);
+ GNUNET_free (prph);
+ return NULL;
+ }
TALER_wallet_purse_merge_sign (payto_uri,
prph->merge_timestamp,
&prph->purse_pub,
@@ -523,6 +533,11 @@ TALER_EXCHANGE_post_reserves_purse_start (
gf = TALER_EXCHANGE_get_global_fee (
prph->keys,
GNUNET_TIME_timestamp_get ());
+ if (NULL == gf)
+ {
+ GNUNET_break_op (0);
+ return TALER_EC_EXCHANGE_GENERIC_GLOBAL_FEES_MISSING;
+ }
purse_fee = gf->fees.purse;
}
else