commit 35317cd9bf3eab1581ed70ae009a8cd96f99ac20
parent 510bcb911ce9aea189663690711da71fcc34b328
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Sat, 11 Jul 2026 21:31:34 +0200
do not return on-stack trait
Diffstat:
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c
@@ -433,6 +433,12 @@ struct PayState
const char *amount_with_fee;
/**
+ * Parsed version of @e amount_with_fee, kept in persistent
+ * command state so it can be safely exposed via the amount trait.
+ */
+ struct TALER_Amount amount_with_fee_parsed;
+
+ /**
* Amount to be paid, including NO fees.
*/
const char *amount_without_fee;
@@ -1527,11 +1533,9 @@ pay_traits (void *cls,
return GNUNET_SYSERR;
}
{
- struct TALER_Amount amount_with_fee;
-
GNUNET_assert (GNUNET_OK ==
TALER_string_to_amount (ps->amount_with_fee,
- &amount_with_fee));
+ &ps->amount_with_fee_parsed));
{
struct TALER_TESTING_Trait traits[] = {
TALER_TESTING_make_trait_proposal_reference (ps->proposal_reference),
@@ -1540,7 +1544,7 @@ pay_traits (void *cls,
TALER_TESTING_make_trait_order_id (order_id),
TALER_TESTING_make_trait_merchant_pub (merchant_pub),
TALER_TESTING_make_trait_merchant_sig (&ps->merchant_sig),
- TALER_TESTING_make_trait_amount (&amount_with_fee),
+ TALER_TESTING_make_trait_amount (&ps->amount_with_fee_parsed),
TALER_TESTING_make_trait_otp_key (ps->pos_key),
TALER_TESTING_make_trait_otp_alg (&ps->pos_alg),
TALER_TESTING_make_trait_token_priv (index,