diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-01-18 22:56:12 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-01-18 22:56:12 +0100 |
commit | 1f2dee5ae8c902e10c8e2a00b57147b2169275a3 (patch) | |
tree | e07b8949a99da7b61c61d156531a599fcaef069d /src/mint-lib | |
parent | 1eea4abe07cbcde11f67df58be08a4f59803e7f1 (diff) |
check return value from TALER_amount_subtract()
Diffstat (limited to 'src/mint-lib')
-rw-r--r-- | src/mint-lib/mint_api_deposit.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mint-lib/mint_api_deposit.c b/src/mint-lib/mint_api_deposit.c index 8f7b6db06..58436adfa 100644 --- a/src/mint-lib/mint_api_deposit.c +++ b/src/mint-lib/mint_api_deposit.c @@ -434,6 +434,14 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint, TALER_LOG_WARNING ("Denomination key unknown to mint\n"); return NULL; } + if (GNUNET_SYSERR == + TALER_amount_subtract (&amount_without_fee, + amount, + &dki->fee_deposit)) + { + GNUNET_break (0); + return NULL; + } if (GNUNET_OK != verify_signatures (dki, @@ -492,9 +500,6 @@ TALER_MINT_deposit (struct TALER_MINT_Handle *mint, dh->depconf.transaction_id = GNUNET_htonll (transaction_id); dh->depconf.timestamp = GNUNET_TIME_absolute_hton (timestamp); dh->depconf.refund_deadline = GNUNET_TIME_absolute_hton (refund_deadline); - TALER_amount_subtract (&amount_without_fee, - amount, - &dki->fee_deposit); TALER_amount_hton (&dh->depconf.amount_without_fee, &amount_without_fee); dh->depconf.coin_pub = *coin_pub; |