[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-exchange] 01/02: check json_pack return value, just
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-exchange] 01/02: check json_pack return value, just to be nice |
Date: |
Sun, 07 May 2017 14:21:43 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
commit 0e73c0d4513a360ba3b5bcbe70ef4aeb59f68e3c
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun May 7 14:07:48 2017 +0200
check json_pack return value, just to be nice
---
src/exchange-lib/exchange_api_admin.c | 5 +++++
src/exchange-lib/exchange_api_deposit.c | 5 +++++
src/exchange-lib/exchange_api_payback.c | 8 ++++++--
src/exchange-lib/exchange_api_refresh.c | 10 ++++++++++
src/exchange-lib/exchange_api_refund.c | 8 ++++++--
src/exchange-lib/exchange_api_reserve.c | 6 ++++++
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 e6cb810..6049c54 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 7eb6f5b..72f588f 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 30cd55c..8096e55 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 08f5e2d..84fb3b7 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 4a0cac5..dc6d5d7 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 c7f59c2..89c4fdc 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 9b63821..34cf4ea 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;
--
To stop receiving notification emails like this one, please contact
address@hidden