summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2021-03-05 20:13:01 +1300
committerKarolin Seeger <kseeger@samba.org>2021-03-22 11:53:16 +0100
commitbc967501aeb5788856f4915fec296557ae4da290 (patch)
tree8054a78639a83df89866ec37b139b82efc2b065f
parentc99c29e1e3490a559a16d2bd72b9aca80f1f1d38 (diff)
downloadsamba-bc967501aeb5788856f4915fec296557ae4da290.tar.gz
CVE-2021-20277 ldb tests: ldb_match tests with extra spaces
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14655 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry-picked from commit for master)
-rw-r--r--lib/ldb/tests/ldb_match_test.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/ldb/tests/ldb_match_test.c b/lib/ldb/tests/ldb_match_test.c
index 3028aed072c..ba6ea56be15 100644
--- a/lib/ldb/tests/ldb_match_test.c
+++ b/lib/ldb/tests/ldb_match_test.c
@@ -181,6 +181,8 @@ static void test_wildcard_match(void **state)
size_t failed = 0;
size_t i;
struct wildcard_test tests[] = {
+ TEST_ENTRY(" 1 0", "1*0*", true, true),
+ TEST_ENTRY(" 1 0", "1 *0", true, true),
TEST_ENTRY("The value.......end", "*end", true, true),
TEST_ENTRY("The value.......end", "*fend", false, true),
TEST_ENTRY("The value.......end", "*eel", false, true),
@@ -203,8 +205,12 @@ static void test_wildcard_match(void **state)
TEST_ENTRY("1\n0\r0\t000.0.0.0.0", "1*0*0*0*0*0*0*0*0", true,
true),
/*
- * We allow NUL bytes in non-casefolding syntaxes.
+ * We allow NUL bytes and redundant spaces in non-casefolding
+ * syntaxes.
*/
+ TEST_ENTRY(" 1 0", "*1 0", true, false),
+ TEST_ENTRY(" 1 0", "*1 0", true, false),
+ TEST_ENTRY("1 0", "*1 0", false, false),
TEST_ENTRY("1\x00 x", "1*x", true, false),
TEST_ENTRY("1\x00 x", "*x", true, false),
TEST_ENTRY("1\x00 x", "*x*", true, false),