commit 41fcc9c995e484a291dbabcc4d2004cb7209813f parent 8877a3349edc67fed937553404c17c60179f73b7 Author: Christian Grothoff <grothoff@gnunet.org> Date: Fri, 17 Jul 2026 19:19:31 +0200 fix is-array check to include NULL case Diffstat:
| M | src/lib/donau_api_charities_get.c | | | 7 | ++++--- |
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/lib/donau_api_charities_get.c b/src/lib/donau_api_charities_get.c @@ -74,14 +74,15 @@ handle_charities_get_ok (const json_t *resp_obj, struct DONAU_CharitySummary *charities = NULL; const json_t *ca = json_object_get (resp_obj, "charities"); - size_t num_charity - = json_array_size (ca); + size_t num_charity; - if (JSON_ARRAY != json_typeof (ca)) + if ( (NULL == ca) || + (! json_is_array (ca)) ) { GNUNET_break_op (0); return GNUNET_SYSERR; } + num_charity = json_array_size (ca); if (0 != num_charity) { size_t index;