mirror of
https://github.com/troglobit/finit.git
synced 2026-10-16 10:39:35 +00:00
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 <troglobit@gmail.com>
This commit is contained in:
1 parent
5b9d99011b
commit
07a364e570
1 file changed
+1
-1
+1
-1
@@ -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 <NAME>[:ID]\n",
|
||||
cmd == INIT_CMD_START_SVC ? "start" :
|
||||
(cmd == INIT_CMD_STOP_SVC ? "stop" : "restart"));
|
||||
|
||||
Reference in new issue
Block a user