From 59063efa62fbb75bb75ad34a9e9c551b77284377 Mon Sep 17 00:00:00 2001 From: John Horne Date: Mon, 20 Apr 2020 20:16:29 +0100 Subject: [PATCH] Ensure the command name is not null before logging it. --- src/do_command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/do_command.c b/src/do_command.c index 76939a1..d1594c6 100644 --- a/src/do_command.c +++ b/src/do_command.c @@ -592,7 +592,7 @@ static int child_process(entry * e, char **jobenv) { if ((e->flags & DONT_LOG) == 0) { char *x = mkprints((u_char *) e->cmd, strlen(e->cmd)); - log_it(usernm, getpid(), "CMDEND", x, 0); + log_it(usernm, getpid(), "CMDEND", x ? x : "Unknown command" , 0); free(x); } return OK_EXIT; -- 1.8.3.1