]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/main.c
fix off by one error in array index assertion
authorDave Reisner <dreisner@archlinux.org>
Sat, 8 Mar 2014 22:32:53 +0000 (17:32 -0500)
committerDave Reisner <dreisner@archlinux.org>
Sat, 8 Mar 2014 22:57:18 +0000 (17:57 -0500)
commit26abdc73a212b90f7c4b71808a1028d2e87ab09f
treef341ae81dbc7f6129359c988028a088ad0898abe
parentd5ce683c0780c02cf657be4f5cff506edf913f0a
fix off by one error in array index assertion

Since the index is already post-incremented when the array is appended
to, this assertion can be wrongly reached when the array is at capacity
(with the NULL terminator). The bug is reproducible on shutdown with
the following settings in /etc/systemd/system.conf:

  LogTarget=journal-or-kmsg
  LogColor=yes
  LogLocation=yes

Reported by Thermi on IRC.
src/core/main.c