diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-05-07 14:07:48 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-05-07 14:07:48 +0200 |
commit | 0e73c0d4513a360ba3b5bcbe70ef4aeb59f68e3c (patch) | |
tree | 0887e31dabaeef49eb2ebd50a1caed9e765b597f /src/exchange-lib | |
parent | 76545519c647b66ef99391b503f5d90fd4a43cb4 (diff) | |
download | exchange-0e73c0d4513a360ba3b5bcbe70ef4aeb59f68e3c.tar.xz |
check json_pack return value, just to be nice
Diffstat (limited to 'src/exchange-lib')
-rw-r--r-- | src/exchange-lib/exchange_api_admin.c | 5 | ||||
-rw-r--r-- | src/exchange-lib/exchange_api_deposit.c | 5 | ||||
-rw-r--r-- | src/exchange-lib/exchange_api_payback.c | 8 | ||||
-rw-r--r-- | src/exchange-lib/exchange_api_refresh.c | 10 | ||||
-rw-r--r-- | src/exchange-lib/exchange_api_refund.c | 8 | ||||
-rw-r--r-- | src/exchange-lib/exchange_api_reserve.c | 6 | ||||
-rw-r--r-- | src/exchange-lib/exchange_api_track_transaction.c | 5 |
7 files changed, 43 insertions, 4 deletions
diff --git a/src/exchange-lib/exchange_api_admin.c b/src/exchange-lib/exchange_api_admin.c index e6cb8101c..6049c544d 100644 --- a/src/exchange-lib/exchange_api_admin.c +++ b/src/exchange-lib/exchange_api_admin.c @@ -187,6 +187,11 @@ TALER_EXCHANGE_admin_add_incoming (struct TALER_EXCHANGE_Handle *exchange, "execution_date", GNUNET_JSON_from_time_abs (execution_date), "sender_account_details", sender_account_details, "transfer_details", transfer_details); + if (NULL == admin_obj) + { + GNUNET_break (0); + return NULL; + } aai = GNUNET_new (struct TALER_EXCHANGE_AdminAddIncomingHandle); aai->exchange = exchange; aai->cb = res_cb; diff --git a/src/exchange-lib/exchange_api_deposit.c b/src/exchange-lib/exchange_api_deposit.c index 7eb6f5b79..72f588f46 100644 --- a/src/exchange-lib/exchange_api_deposit.c +++ b/src/exchange-lib/exchange_api_deposit.c @@ -463,6 +463,11 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange, "wire_transfer_deadline", GNUNET_JSON_from_time_abs (wire_deadline), "coin_sig", GNUNET_JSON_from_data_auto (coin_sig) ); + if (NULL == deposit_obj) + { + GNUNET_break (0); + return NULL; + } dh = GNUNET_new (struct TALER_EXCHANGE_DepositHandle); dh->exchange = exchange; diff --git a/src/exchange-lib/exchange_api_payback.c b/src/exchange-lib/exchange_api_payback.c index 30cd55cba..8096e55f8 100644 --- a/src/exchange-lib/exchange_api_payback.c +++ b/src/exchange-lib/exchange_api_payback.c @@ -57,7 +57,7 @@ struct TALER_EXCHANGE_PaybackHandle * Denomination key of the coin. */ const struct TALER_EXCHANGE_DenomPublicKey *pk; - + /** * Handle for the request. */ @@ -306,7 +306,11 @@ TALER_EXCHANGE_payback (struct TALER_EXCHANGE_Handle *exchange, "coin_sig", GNUNET_JSON_from_data_auto (&coin_sig), "coin_blind_key_secret", GNUNET_JSON_from_data_auto (blinding_key) ); - GNUNET_assert (NULL != payback_obj); + if (NULL == payback_obj) + { + GNUNET_break (0); + return NULL; + } ph = GNUNET_new (struct TALER_EXCHANGE_PaybackHandle); ph->coin_pub = pr.coin_pub; diff --git a/src/exchange-lib/exchange_api_refresh.c b/src/exchange-lib/exchange_api_refresh.c index 08f5e2d85..84fb3b7b4 100644 --- a/src/exchange-lib/exchange_api_refresh.c +++ b/src/exchange-lib/exchange_api_refresh.c @@ -1337,6 +1337,11 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange, "melt_coin", melt_coin, "coin_evs", coin_evs, "transfer_pubs", transfer_pubs); + if (NULL == melt_obj) + { + GNUNET_break (0); + return NULL; + } /* and now we can at last begin the actual request handling */ rmh = GNUNET_new (struct TALER_EXCHANGE_RefreshMeltHandle); @@ -1723,6 +1728,11 @@ TALER_EXCHANGE_refresh_reveal (struct TALER_EXCHANGE_Handle *exchange, GNUNET_JSON_from_data_auto (&md->melt_session_hash), "transfer_privs", transfer_privs); + if (NULL == reveal_obj) + { + GNUNET_break (0); + return NULL; + } /* finally, we can actually issue the request */ rrh = GNUNET_new (struct TALER_EXCHANGE_RefreshRevealHandle); diff --git a/src/exchange-lib/exchange_api_refund.c b/src/exchange-lib/exchange_api_refund.c index 4a0cac5b5..dc6d5d7a2 100644 --- a/src/exchange-lib/exchange_api_refund.c +++ b/src/exchange-lib/exchange_api_refund.c @@ -279,8 +279,12 @@ TALER_EXCHANGE_refund (struct TALER_EXCHANGE_Handle *exchange, "merchant_pub", GNUNET_JSON_from_data_auto (&rr.merchant), "merchant_sig", GNUNET_JSON_from_data_auto (&merchant_sig) ); - GNUNET_assert (NULL != refund_obj); - + if (NULL == refund_obj) + { + GNUNET_break (0); + return NULL; + } + rh = GNUNET_new (struct TALER_EXCHANGE_RefundHandle); rh->exchange = exchange; rh->cb = cb; diff --git a/src/exchange-lib/exchange_api_reserve.c b/src/exchange-lib/exchange_api_reserve.c index c7f59c25d..89c4fdc08 100644 --- a/src/exchange-lib/exchange_api_reserve.c +++ b/src/exchange-lib/exchange_api_reserve.c @@ -1015,6 +1015,12 @@ TALER_EXCHANGE_reserve_withdraw (struct TALER_EXCHANGE_Handle *exchange, "reserve_pub", GNUNET_JSON_from_data_auto (&wsh->reserve_pub), "reserve_sig", GNUNET_JSON_from_data_auto (&reserve_sig)); GNUNET_free (coin_ev); + if (NULL == withdraw_obj) + { + GNUNET_break (0); + return NULL; + } + wsh->blinding_key = *blinding_key; wsh->url = MAH_path_to_url (exchange, "/reserve/withdraw"); diff --git a/src/exchange-lib/exchange_api_track_transaction.c b/src/exchange-lib/exchange_api_track_transaction.c index 9b6382165..34cf4ea9e 100644 --- a/src/exchange-lib/exchange_api_track_transaction.c +++ b/src/exchange-lib/exchange_api_track_transaction.c @@ -303,6 +303,11 @@ TALER_EXCHANGE_track_transaction (struct TALER_EXCHANGE_Handle *exchange, "coin_pub", GNUNET_JSON_from_data_auto (coin_pub), "merchant_pub", GNUNET_JSON_from_data_auto (&dtp.merchant), "merchant_sig", GNUNET_JSON_from_data_auto (&merchant_sig)); + if (NULL == deposit_wtid_obj) + { + GNUNET_break (0); + return NULL; + } dwh = GNUNET_new (struct TALER_EXCHANGE_TrackTransactionHandle); dwh->exchange = exchange; |