From 7cb48a720bdcddc96e3d29f85408ea41578a2835 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 26 Sep 2017 12:30:24 +0200 Subject: check json_array_append_new() return values, proper logging on errors --- src/exchange-lib/exchange_api_handle.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/exchange-lib/exchange_api_handle.c') diff --git a/src/exchange-lib/exchange_api_handle.c b/src/exchange-lib/exchange_api_handle.c index 947d935b..d61e2c90 100644 --- a/src/exchange-lib/exchange_api_handle.c +++ b/src/exchange-lib/exchange_api_handle.c @@ -516,8 +516,10 @@ decode_keys_json (const json_t *resp_obj, unsigned int current; if (JSON_OBJECT != json_typeof (resp_obj)) + { + GNUNET_break_op (0); return GNUNET_SYSERR; - + } /* check the version */ { const char *ver; @@ -527,10 +529,14 @@ decode_keys_json (const json_t *resp_obj, GNUNET_JSON_spec_end() }; - EXITIF (GNUNET_OK != - GNUNET_JSON_parse (resp_obj, - spec, - NULL, NULL)); + if (GNUNET_OK != + GNUNET_JSON_parse (resp_obj, + spec, + NULL, NULL)) + { + GNUNET_break_op (0); + return GNUNET_SYSERR; + } if (3 != sscanf (ver, "%u:%u:%u", ¤t, -- cgit v1.2.3