twister

HTTP fault injector for testing
Log | Files | Refs | README | LICENSE

commit 17b2aa026e2a4f0a96c255ebb1045085f8418187
parent 9efab5f6c36567bbd8645e65cb0d7f5c75e6b329
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 10 Aug 2020 08:07:59 +0200

fix NPE issue

Diffstat:
Msrc/twister/taler-twister-service.c | 14++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c @@ -1634,6 +1634,7 @@ create_response (void *cls, hr->io_len, JSON_COMPACT); json_decref (hr->json); + hr->json = NULL; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Generating curl request\n"); @@ -1893,8 +1894,17 @@ create_response (void *cls, GNUNET_free (hr->io_buf); hr->io_buf = json_dumps (hr->json, JSON_COMPACT); - hr->io_len = strlen (hr->io_buf); + if (NULL != hr->io_buf) + { + hr->io_len = strlen (hr->io_buf); + } + else + { + GNUNET_break (0); + hr->io_len = 0; + } json_decref (hr->json); + hr->json = NULL; } if (GNUNET_YES == malform) @@ -2735,7 +2745,7 @@ handle_modify_path_ul (void *cls, */ static int check_modify_header_dl (void *cls, - const struct TWISTER_ModifyPath *src) + const struct TWISTER_ModifyPath *src) { return GNUNET_OK; }