From 07a364e570622bd152247bbad7e40c0c62f882e0 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 5 Mar 2021 10:51:25 +0100 Subject: [PATCH] initctl: fix use of possibly unterminated string, found by Coverity No point in using rq.data, which could have been modified, instead use the input argument to the function in the error message. Signed-off-by: Joachim Wiberg --- src/initctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/initctl.c b/src/initctl.c index b141296a..b963a71e 100644 --- a/src/initctl.c +++ b/src/initctl.c @@ -208,7 +208,7 @@ static int do_startstop(int cmd, char *arg) strlcpy(rq.data, arg, sizeof(rq.data)); if (client_send(&rq, sizeof(rq))) { - fprintf(stderr, "No such task or service(s): %s\n\n", rq.data); + fprintf(stderr, "No such task or service(s): %s\n\n", arg); fprintf(stderr, "Usage: initctl %s [:ID]\n", cmd == INIT_CMD_START_SVC ? "start" : (cmd == INIT_CMD_STOP_SVC ? "stop" : "restart"));