merchant

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

commit 306c53f567be0c05382b49fc5c0c357a9380d632
parent 233d95e4231ba5921c86074b435406287d5d10ea
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat, 19 Dec 2015 19:48:57 +0100

added amount sanity checking

Diffstat:
Msrc/lib/merchant_api_pay.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c @@ -356,7 +356,7 @@ TALER_MERCHANT_pay_frontend (struct TALER_MERCHANT_Context *merchant, if (GNUNET_OK == TALER_amount_subtract (&fee_left, &total_fee, - &max_fee)) + max_fee)) { /* Wallet must cover part of the fee! */ struct TALER_Amount new_amount; @@ -364,7 +364,7 @@ TALER_MERCHANT_pay_frontend (struct TALER_MERCHANT_Context *merchant, if (GNUNET_OK != TALER_amount_add (&new_amount, &fee_left, - &amount)) + amount)) { /* integer overflow */ GNUNET_break (0); @@ -388,7 +388,7 @@ TALER_MERCHANT_pay_frontend (struct TALER_MERCHANT_Context *merchant, /* Full fee covered by merchant, but our total must at least cover the total contract amount */ if (1 == - TALER_amount_cmp (&amount, + TALER_amount_cmp (amount, &total_amount)) { /* amount > total_amount: all of the coins (total_amount) do