From cb64d39ffdaa7bff77987d732c43da03f4d3ae7d Mon Sep 17 00:00:00 2001 From: Arkadiusz Hiler Date: Thu, 20 Jun 2019 15:29:01 +0300 Subject: runner/resultgen: Don't pass NULL to str*() functions If we don't get values from the JSON strlen() and strcmp() on them would dereference NULL pointer. Cc: Petri Latvala Signed-off-by: Arkadiusz Hiler Reviewed-by: Petri Latvala --- runner/resultgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runner') diff --git a/runner/resultgen.c b/runner/resultgen.c index 7b4cd519..58b95220 100644 --- a/runner/resultgen.c +++ b/runner/resultgen.c @@ -866,7 +866,7 @@ static void fill_from_journal(int fd, static void override_result_single(struct json_object *obj) { - const char *errtext = NULL, *result = NULL; + const char *errtext = "", *result = ""; struct json_object *textobj; bool dmesgwarns = false; -- cgit v1.2.3