]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/mangle: check for end of string on every iteration
authorDave Reisner <dreisner@archlinux.org>
Sun, 13 May 2012 19:14:49 +0000 (15:14 -0400)
committerKarel Zak <kzak@redhat.com>
Tue, 15 May 2012 09:32:24 +0000 (11:32 +0200)
commitea178007eb63a528f27805c04b5246519b5ef61a
tree57693924a60f17ba72f1113098c27e25ec43c534
parent5821dbe32894b07a52f8d924d31a13b425b69638
lib/mangle: check for end of string on every iteration

Checking for the null byte at the end of the string only conditionally
leads to segfaults, evidenced by mount helpers crashing on writes to
/run/mount/utab. Simply check for the null on each iteration, and append
a null byte to the mangled string before breaking.

Signed-off-by: Dave Reisner <dreisner@archlinux.org>
lib/mangle.c