fix #3716: make sure amount-API offers proper checks against overflow and other issues
This commit is contained in:
parent
1f3f4ed8dd
commit
6ba63aab84
@ -1092,7 +1092,11 @@ TALER_MINT_DB_insert_collectable_blindcoin (PGconn *db_conn,
|
|||||||
if (GNUNET_OK != TALER_MINT_DB_reserve_get (db_conn,
|
if (GNUNET_OK != TALER_MINT_DB_reserve_get (db_conn,
|
||||||
&reserve))
|
&reserve))
|
||||||
goto rollback;
|
goto rollback;
|
||||||
reserve.balance = TALER_amount_subtract (reserve.balance, withdraw);
|
if (GNUNET_SYSERR ==
|
||||||
|
TALER_amount_subtract (&reserve.balance,
|
||||||
|
&reserve.balance,
|
||||||
|
&withdraw))
|
||||||
|
goto rollback;
|
||||||
if (GNUNET_OK != reserves_update (db_conn, &reserve))
|
if (GNUNET_OK != reserves_update (db_conn, &reserve))
|
||||||
goto rollback;
|
goto rollback;
|
||||||
if (GNUNET_OK == TALER_MINT_DB_commit (db_conn))
|
if (GNUNET_OK == TALER_MINT_DB_commit (db_conn))
|
||||||
|
Loading…
Reference in New Issue
Block a user