From 3118c34652fde180515e0cc37a996dd249369afb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 9 Sep 2017 22:19:48 +0200 Subject: work on #5092: be conservative, allow TALER_EXCHANGE_get_keys() to return NULL and treat as error properly --- src/backend/taler-merchant-httpd_exchanges.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/backend/taler-merchant-httpd_exchanges.c') diff --git a/src/backend/taler-merchant-httpd_exchanges.c b/src/backend/taler-merchant-httpd_exchanges.c index aca91603..4403ec1e 100644 --- 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; -- cgit v1.2.3