[SCM] Samba Shared Repository - branch master updated

Andreas Schneider asn at samba.org
Fri May 28 09:51:01 UTC 2021


The branch, master has been updated
       via  537f2d19b55 pidl: Handle assigning to an inline array from Python
       via  9019e08c61a pytest:segfault: Add test for assigning to an inline array
      from  f7cf8132b00 ctdb-tests: Add debug_locks.sh tests for mutexes

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 537f2d19b5513fa9c29034bc53958a2c05768e81
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Thu May 6 12:05:26 2021 +1200

    pidl: Handle assigning to an inline array from Python
    
    When obtaining a reference to items in an assigned-from list, ensure
    that we do not try to use the first element of the inline array as a
    talloc context, but instead use the talloc context associated with the
    Python object.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14065
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    
    Autobuild-User(master): Andreas Schneider <asn at cryptomilk.org>
    Autobuild-Date(master): Fri May 28 09:50:02 UTC 2021 on sn-devel-184

commit 9019e08c61a9b0bfce9ef295089ad42e46e784e2
Author: Joseph Sutton <josephsutton at catalyst.net.nz>
Date:   Sat May 8 11:33:43 2021 +1200

    pytest:segfault: Add test for assigning to an inline array
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14065
    
    Signed-off-by: Joseph Sutton <josephsutton at catalyst.net.nz>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 pidl/lib/Parse/Pidl/Samba4/Python.pm | 6 +++++-
 python/samba/tests/segfault.py       | 8 ++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 578e17d1cbc..5c4d3e8e087 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1988,7 +1988,11 @@ sub ConvertObjectFromPythonLevel($$$$$$$$$)
 			}
 			$self->pidl("for ($counter = 0; $counter < PyList_GET_SIZE($py_var); $counter++) {");
 			$self->indent;
-			$self->ConvertObjectFromPythonLevel($env, $var_name, "PyList_GET_ITEM($py_var, $counter)", $e, $nl, $var_name."[$counter]", $fail, 0);
+			if (ArrayDynamicallyAllocated($e, $l)) {
+				$self->ConvertObjectFromPythonLevel($env, $var_name, "PyList_GET_ITEM($py_var, $counter)", $e, $nl, $var_name."[$counter]", $fail, 0);
+			} else {
+				$self->ConvertObjectFromPythonLevel($env, $mem_ctx, "PyList_GET_ITEM($py_var, $counter)", $e, $nl, $var_name."[$counter]", $fail, 0);
+			}
 			$self->deindent;
 			$self->pidl("}");
 			$self->deindent;
diff --git a/python/samba/tests/segfault.py b/python/samba/tests/segfault.py
index c6e17ed6ead..1b9c9a0cab6 100644
--- a/python/samba/tests/segfault.py
+++ b/python/samba/tests/segfault.py
@@ -184,3 +184,11 @@ class SegfaultTests(samba.tests.TestCase):
     def test_dcerpc_idl_inline_arrays(self):
         """Inline arrays were incorrectly handled."""
         dnsserver.DNS_RPC_SERVER_INFO_DOTNET().pExtensions
+
+    @no_gdb_backtrace
+    @segfault_detector
+    def test_dcerpc_idl_set_inline_arrays(self):
+        """Setting an inline array was incorrectly handled."""
+        a = dnsserver.DNS_EXTENSION();
+        x = dnsserver.DNS_RPC_DP_INFO();
+        x.pwszReserved = [a, a, a]


-- 
Samba Shared Repository



More information about the samba-cvs mailing list