summaryrefslogtreecommitdiff
path: root/src/exchange-lib
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-09-26 12:30:24 +0200
committerChristian Grothoff <christian@grothoff.org>2017-09-26 12:30:24 +0200
commit7cb48a720bdcddc96e3d29f85408ea41578a2835 (patch)
tree149f79838c9fd0d738f92fd45dd86fa77ff8c4a1 /src/exchange-lib
parenta3b71ac75b38d79d280b0023c33b99e55ac46c4f (diff)
downloadexchange-7cb48a720bdcddc96e3d29f85408ea41578a2835.tar.gz
exchange-7cb48a720bdcddc96e3d29f85408ea41578a2835.tar.bz2
exchange-7cb48a720bdcddc96e3d29f85408ea41578a2835.zip
check json_array_append_new() return values, proper logging on errors
Diffstat (limited to 'src/exchange-lib')
-rw-r--r--src/exchange-lib/exchange_api_handle.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/exchange-lib/exchange_api_handle.c b/src/exchange-lib/exchange_api_handle.c
index 947d935b2..d61e2c908 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",
&current,