From 272e20adbbbaebd7bbf94c79f44f1ff42d2831d8 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Tue, 29 Oct 2019 12:02:04 +1300 Subject: [PATCH] pytests/segfaults: dcerpc ref elements segfault These are just a couple of examples. Signed-off-by: Douglas Bagnall Reviewed-by: Noel Power --- python/samba/tests/segfault.py | 14 +++++++++++++- selftest/knownfail.d/python-segfaults | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/python/samba/tests/segfault.py b/python/samba/tests/segfault.py index 65937883156..82c4e2b3806 100644 --- a/python/samba/tests/segfault.py +++ b/python/samba/tests/segfault.py @@ -25,7 +25,7 @@ import sys from samba.net import Net, LIBNET_JOIN_AUTOMATIC from samba.credentials import DONT_USE_KERBEROS from samba import NTSTATUSError, ntstatus -from samba.dcerpc import misc, drsuapi +from samba.dcerpc import misc, drsuapi, samr, unixinfo from samba import auth, gensec from samba.samdb import SamDB from samba import netbios @@ -157,3 +157,15 @@ class SegfaultTests(samba.tests.TestCase): def test_rpcecho(self): from dcerpc import echo echo.rpcecho("") + + @segfault_detector + def test_dcerpc_idl_ref_elements(self): + """There are many pidl generated functions that crashed on this + pattern, where a NULL pointer was created rather than an empty + structure.""" + samr.Connect5().out_info_out = 1 + + @segfault_detector + def test_dcerpc_idl_unixinfo_elements(self): + """Dereferencing is sufficient to crash""" + unixinfo.GetPWUid().out_infos diff --git a/selftest/knownfail.d/python-segfaults b/selftest/knownfail.d/python-segfaults index 1be0566dcb1..4e1905ee296 100644 --- a/selftest/knownfail.d/python-segfaults +++ b/selftest/knownfail.d/python-segfaults @@ -1 +1,3 @@ samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_net_replicate_init__3 +samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_dcerpc_idl_ref_elements +samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_dcerpc_idl_unixinfo_elements -- 2.47.3