From 7e725a7a8a9d4d8ff31c509aded6f69828a0cab2 Mon Sep 17 00:00:00 2001 From: Martin Schanzenbach Date: Fri, 9 Dec 2022 23:54:05 +0900 Subject: TESTING: Fix NP deref --- src/testing/testing_api_loop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/testing') diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c index f133956cf..dac4e5deb 100644 --- a/src/testing/testing_api_loop.c +++ b/src/testing/testing_api_loop.c @@ -259,7 +259,7 @@ finish_test (void *cls) is->finishing = GNUNET_YES; is->final_task = NULL; label = is->commands[is->ip].label; - if (NULL == label) + if (NULL == is->commands[is->ip].run) label = "END"; GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Interpreter finishes at `%s' with status %d\n", @@ -538,7 +538,8 @@ GNUNET_TESTING_command_new (void *cls, .traits = traits }; memset (&cmd, 0, sizeof (cmd)); - strncpy (cmd.label, label, GNUNET_TESTING_CMD_MAX_LABEL_LENGTH); + if (NULL != label) + strncpy (cmd.label, label, GNUNET_TESTING_CMD_MAX_LABEL_LENGTH); return cmd; -- cgit v1.2.3