]> git.sur5r.net Git - i3/i3/commit
fake_outputs: Don't read past the end of string
authorVladimir Panteleev <git@thecybershadow.net>
Tue, 19 Sep 2017 14:37:35 +0000 (14:37 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 19 Sep 2017 16:58:28 +0000 (18:58 +0200)
commitc932c88ea920917ebe6fd63f42953cfedd1265c9
tree5352f80647431e3ee0797f862b940f28eb4708f0
parent4ddf18ef6ba6986ae566a8b615491244c4ace8d0
fake_outputs: Don't read past the end of string

fake_outputs_init would unconditionally increase the string read
pointer variable (walk) by one character more than the number of
characters that have been read, to skip past the character delimiting
records (a comma). However, when the input string was not terminated
by a comma, it would cause the function to read past the null
terminator instead.

Avoid this by explicitly checking for the expected delimiter.
src/fake_outputs.c