summaryrefslogtreecommitdiff
path: root/src/boot/efi/test-efi-string.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-06-10 11:43:00 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2022-06-10 12:05:38 +0900
commitda5fb1877dca6ec713b70f7c8646b4233769d015 (patch)
treebaab65b305bdb3f89a4838b77006899d9ba66ac6 /src/boot/efi/test-efi-string.c
parent8bf796eeac340cf2b13030bd6c0287ad4b63f48d (diff)
downloadsystemd-da5fb1877dca6ec713b70f7c8646b4233769d015.tar.gz
boot/efi-string: check the end of haystack before testing remaining pattern
Fixes buffer-overflow reported at https://github.com/systemd/systemd/pull/23589#issuecomment-1151820341.
Diffstat (limited to 'src/boot/efi/test-efi-string.c')
-rw-r--r--src/boot/efi/test-efi-string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/boot/efi/test-efi-string.c b/src/boot/efi/test-efi-string.c
index 5aaa1f713f..178ad766cb 100644
--- a/src/boot/efi/test-efi-string.c
+++ b/src/boot/efi/test-efi-string.c
@@ -344,6 +344,7 @@ TEST(efi_fnmatch) {
TEST_FNMATCH_ONE("*", "123", true);
TEST_FNMATCH_ONE("**", "abcd", true);
TEST_FNMATCH_ONE("*b*", "abcd", true);
+ TEST_FNMATCH_ONE("abc*d", "abc", false);
TEST_FNMATCH_ONE("*.conf", "arch.conf", true);
TEST_FNMATCH_ONE("debian-*.conf", "debian-wheezy.conf", true);
TEST_FNMATCH_ONE("debian-*.*", "debian-wheezy.efi", true);