diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-12-19 19:48:57 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-12-19 19:48:57 +0100 |
commit | 306c53f567be0c05382b49fc5c0c357a9380d632 (patch) | |
tree | 0ab36dfae602efbd223d3a072893257801798088 /src/lib/merchant_api_pay.c | |
parent | 233d95e4231ba5921c86074b435406287d5d10ea (diff) | |
download | merchant-306c53f567be0c05382b49fc5c0c357a9380d632.tar.gz merchant-306c53f567be0c05382b49fc5c0c357a9380d632.tar.bz2 merchant-306c53f567be0c05382b49fc5c0c357a9380d632.zip |
added amount sanity checking
Diffstat (limited to 'src/lib/merchant_api_pay.c')
-rw-r--r-- | src/lib/merchant_api_pay.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/merchant_api_pay.c b/src/lib/merchant_api_pay.c index 03514d6c..40818e99 100644 --- 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 |