mirror of
https://github.com/systemd/systemd.git
synced 2026-08-03 22:50:29 +00:00
core/main: restore the correct assert about array position
'pos' is incremented after each assignment. If we use the maximum number
of arguments, we end up with pos==9 after all the assignments, and it
points to where the next value would be assigned. This position must remain
NULL.
The assert I "fixed" was intentionally introduced in
26abdc73a2 as a bugfix. So my "fix" repeated
the same error that was fixed back then.
This commit is contained in:
committed by
Yu Watanabe
parent
6fc0d6b5ac
commit
14ecfc1cd2
@@ -1572,7 +1572,7 @@ static int become_shutdown(int objective, int retval) {
|
||||
command_line[pos++] = exit_code;
|
||||
}
|
||||
|
||||
assert(pos < ELEMENTSOF(command_line) - 1);
|
||||
assert(pos < ELEMENTSOF(command_line));
|
||||
|
||||
/* The watchdog: */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user