merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 5973ebd3d0204ae525c5e71c5c06704550141139
parent 45f620dc26c76ccd62f1985b1ed24eaf5fceb987
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 21 Apr 2026 21:20:29 +0200

-cov fixes

Diffstat:
Msrc/backend/taler-merchant-httpd_post-orders-ORDER_ID-pay.c | 12++++++++----
Msrc/backend/taler-merchant-httpd_post-private-orders.c | 8+++++---
2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-pay.c b/src/backend/taler-merchant-httpd_post-orders-ORDER_ID-pay.c @@ -1523,7 +1523,6 @@ process_pay_with_keys ( eg->fo = NULL; pc->batch_deposits.pending_at_eg--; GNUNET_SCHEDULER_begin_async_scope (&hc->async_scope_id); - eg->keys = TALER_EXCHANGE_keys_incref (keys); GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Processing payment with keys from exchange %s\n", eg->exchange_url); @@ -1537,6 +1536,7 @@ process_pay_with_keys ( NULL); return; } + eg->keys = TALER_EXCHANGE_keys_incref (keys); if (! TMH_EXCHANGES_is_below_limit (keys, TALER_KYCLOGIC_KYC_TRIGGER_TRANSACTION, &eg->total)) @@ -2391,8 +2391,9 @@ phase_compute_money_pots (struct PayContext *pc) GNUNET_free (pc->compute_money_pots.increments); pc->compute_money_pots.num_pots = 0; - TALER_amount_set_zero (pc->parse_pay.dc[0].cdd.amount.currency, - &assigned); + GNUNET_assert (GNUNET_OK == + TALER_amount_set_zero (pc->parse_pay.dc[0].cdd.amount.currency, + &assigned)); GNUNET_assert (NULL != contract); for (size_t i = 0; i<contract->products_len; i++) { @@ -4169,6 +4170,9 @@ append_output_token_sig (void *cls, struct SignedOutputToken out; unsigned int cnt; + memset (&out, + 0, + sizeof (out)); GNUNET_assert (TALER_MERCHANT_CONTRACT_VERSION_1 == pc->check_contract.contract_terms->version); choice = &pc->check_contract.contract_terms->details.v1 @@ -4809,7 +4813,7 @@ phase_parse_wallet_data (struct PayContext *pc) bkp_obj)) { GNUNET_break_op (0); - for (size_t j = 0; i < j; j++) + for (size_t j = 0; j < i; j++) GNUNET_CRYPTO_blinded_message_decref ( bkps[j].blinded_udi.blinded_message); GNUNET_free (bkps); diff --git a/src/backend/taler-merchant-httpd_post-private-orders.c b/src/backend/taler-merchant-httpd_post-private-orders.c @@ -3546,8 +3546,10 @@ phase_merge_inventory (struct OrderContext *oc) { struct TALER_Amount atomic_amount; - TALER_amount_set_zero (pd.price_array[j].currency, - &atomic_amount); + GNUNET_assert ( + GNUNET_OK == + TALER_amount_set_zero (pd.price_array[j].currency, + &atomic_amount)); atomic_amount.fraction = 1; GNUNET_assert ( GNUNET_OK == @@ -4022,7 +4024,7 @@ phase_parse_order (struct OrderContext *oc) GNUNET_JSON_spec_end () }; enum GNUNET_GenericReturnValue ret; - bool computed_refund_deadline; + bool computed_refund_deadline = false; oc->parse_order.refund_deadline = GNUNET_TIME_UNIT_FOREVER_TS; oc->parse_order.wire_deadline = GNUNET_TIME_UNIT_FOREVER_TS;