CVE-2020-27840: pytests:segfault: add ldb.Dn validate test
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 11 Feb 2021 04:05:14 +0000 (17:05 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 24 Mar 2021 12:05:32 +0000 (12:05 +0000)
ldb.Dn.validate wraps ldb_dn_explode.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14595

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/segfault.py
selftest/knownfail.d/python-segfaults

index c6e17ed6ead50c7acaaf2b1e2090dfbd000aed0e..cf450a4a1aac12d7cea8e5b7a7c13ef51b417e89 100644 (file)
@@ -184,3 +184,9 @@ class SegfaultTests(samba.tests.TestCase):
     def test_dcerpc_idl_inline_arrays(self):
         """Inline arrays were incorrectly handled."""
         dnsserver.DNS_RPC_SERVER_INFO_DOTNET().pExtensions
+
+    @segfault_detector
+    def test_ldb_dn_explode_crash(self):
+        for i in range(106, 550, 5):
+            dn = ldb.Dn(ldb.Ldb(), "a=b%s,c= " % (' ' * i))
+            dn.validate()
index 1be0566dcb1eab45e2509718e14dff7419b27e90..524f7dd013b7a645ee33e307f53879e3655426ab 100644 (file)
@@ -1 +1,2 @@
 samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_net_replicate_init__3
+samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_ldb_dn_explode_crash