diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-05-01 10:06:46 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-05-01 10:06:46 +0200 |
commit | ad237521e982352d41127f8c19576a5a242dbbbd (patch) | |
tree | 0745921f6f20400c1dfa7e48f4fbbc6725f844e6 | |
parent | 66355c18c859b92cf7743dbeb7e5835506ae99a7 (diff) |
check return values
-rw-r--r-- | src/mint-tools/taler-mint-reservemod.c | 12 | ||||
-rw-r--r-- | src/mint/taler-mint-httpd_parsing.c | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/mint-tools/taler-mint-reservemod.c b/src/mint-tools/taler-mint-reservemod.c index ce35ecc4c..762830783 100644 --- a/src/mint-tools/taler-mint-reservemod.c +++ b/src/mint-tools/taler-mint-reservemod.c @@ -162,9 +162,15 @@ reservemod_add (struct TALER_Amount denom) "balance_fraction", "balance_currency", &old_denom)); - TALER_amount_add (&new_denom, - &old_denom, - &denom); + if (GNUNET_OK != + TALER_amount_add (&new_denom, + &old_denom, + &denom)) + { + fprintf (stderr, + "Integer overflow when computing new balance!\n"); + return GNUNET_SYSERR; + } TALER_amount_hton (&new_denom_nbo, &new_denom); result = PQexecParams (db_conn, diff --git a/src/mint/taler-mint-httpd_parsing.c b/src/mint/taler-mint-httpd_parsing.c index 450065c61..a1c189176 100644 --- a/src/mint/taler-mint-httpd_parsing.c +++ b/src/mint/taler-mint-httpd_parsing.c @@ -1041,7 +1041,7 @@ TMH_PARSE_amount_json (struct MHD_Connection *connection, amount->fraction = (uint32_t) fraction; GNUNET_assert (strlen (TMH_mint_currency_string) < TALER_CURRENCY_LEN); strcpy (amount->currency, TMH_mint_currency_string); - TALER_amount_normalize (amount); + (void) TALER_amount_normalize (amount); return GNUNET_OK; } |