|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
From 30711a3651f5b31cb67422bf8197e05d557dbe23 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
From: Dave Reisner <dreisner@archlinux.org>
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
Date: Sat, 8 Mar 2014 17:32:53 -0500
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
Subject: [PATCH] fix off by one error in array index assertion
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
Since the index is already post-incremented when the array is appended
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
to, this assertion can be wrongly reached when the array is at capacity
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
(with the NULL terminator). The bug is reproducible on shutdown with
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
the following settings in /etc/systemd/system.conf:
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
LogTarget=journal-or-kmsg
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
LogColor=yes
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
LogLocation=yes
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
Reported by Thermi on IRC.
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
(cherry picked from commit 26abdc73a212b90f7c4b71808a1028d2e87ab09f)
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
---
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
src/core/main.c | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
diff --git a/src/core/main.c b/src/core/main.c
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
index 4e24f85..15bf684 100644
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
--- a/src/core/main.c
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
+++ b/src/core/main.c
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
@@ -1940,7 +1940,7 @@ finish:
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
if (log_get_show_location())
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
command_line[pos++] = "--log-location";
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
- assert(pos + 1 < ELEMENTSOF(command_line));
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
+ assert(pos < ELEMENTSOF(command_line));
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
if (arm_reboot_watchdog && arg_shutdown_watchdog > 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
dd42fc |
char *e;
|