merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit 3118c34652fde180515e0cc37a996dd249369afb
parent 203ab2ba40774d3e590847e6a3cb13fb0984cfdd
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sat,  9 Sep 2017 22:19:48 +0200

work on #5092: be conservative, allow TALER_EXCHANGE_get_keys() to return NULL and treat as error properly

Diffstat:
Msrc/backend/taler-merchant-httpd_exchanges.c | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c @@ -558,6 +558,7 @@ handle_wire_data (void *cls, const json_t *obj) { struct Exchange *exchange = cls; + const struct TALER_EXCHANGE_Keys *keys; exchange->wire_request = NULL; if (MHD_HTTP_OK != http_status) @@ -568,11 +569,13 @@ handle_wire_data (void *cls, ec); return; } - if (GNUNET_OK != - TALER_EXCHANGE_wire_get_fees (&TALER_EXCHANGE_get_keys (exchange->conn)->master_pub, - obj, - &process_wire_fees, - exchange)) + keys = TALER_EXCHANGE_get_keys (exchange->conn); + if ( (NULL == keys) || + (GNUNET_OK != + TALER_EXCHANGE_wire_get_fees (&keys->master_pub, + obj, + &process_wire_fees, + exchange)) ) { /* Report hard failure to all callbacks! */ struct TMH_EXCHANGES_FindOperation *fo;