]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: avoid endless loop in mnt_get_kernel_cmdline_option
authorBernhard Voelker <mail@bernhard-voelker.de>
Fri, 30 Nov 2012 16:12:12 +0000 (17:12 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 10 Dec 2012 12:15:19 +0000 (13:15 +0100)
commit2c0ba1ce30311c690b738bdc19a08845cb8235c2
tree949e0f7aa3194e5529b3a0aa4a76c752c82ad505
parentc717b0328d0dd111f97b8e19b947249833a909fe
libmount: avoid endless loop in mnt_get_kernel_cmdline_option

The above function infloops when the name to search for can only
be found at the beginning of /proc/cmdline but doesn't match,
e.g. when searching for "ro" in "root=/dev/sda1 quiet vga=0x31a".

* libmount/src/utils.c (mnt_get_kernel_cmdline_option): Replace
while by for loop to ensure the pointer p is incremented.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
libmount/src/utils.c