Fix potential array overrun, found by Coverity

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-05-17 14:22:36 +02:00
1 parent f483a8aeaa
commit ceb4d04d23
1 file changed
+1 -1
+1 -1
View File
@@ -804,7 +804,7 @@ static int service_stop(svc_t *svc)
args[i++] = svc->cmd;
/* this handles, e.g., bridge-stop br0 stop */
for (j = 0; j < MAX_NUM_SVC_ARGS; j++) {
for (j = 0; j < MAX_NUM_SVC_ARGS - 2; j++) {
if (!strlen(svc->args[j]))
break;
args[i++] = svc->args[j];