]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: make mnt_match_options() more robust
authorKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2023 10:33:54 +0000 (11:33 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 27 Feb 2023 10:40:22 +0000 (11:40 +0100)
commit06ee5267516761721ebfbdfa313980cef8e54c66
tree010b2c89ad61c60807670fc5f41d613b30b7b1a0
parent9796957aa6d9b9b02eb6ba1488f6c73050a65bc7
libmount: make mnt_match_options() more robust

* don't allocate and use a buffer for the pattern if the pattern is empty

* make it more obvious how empty pattern and empty optstr is evaluated

* add regression test

Reported-by: Sören Tempel <soeren@soeren-tempel.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/optstr.c
tests/expected/libmount/optstr-match [new file with mode: 0644]
tests/ts/libmount/optstr