From 2e45cd15ec4719b87e45db5e4a5c43dc1432936f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 5 Jan 2011 10:05:47 +0100 Subject: [PATCH] pidl:Samba4/Python: fix segfault when setting pointers to scalars. metze --- pidl/lib/Parse/Pidl/Samba4/Python.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm index 60352ae8d7f..fa18056882c 100644 --- a/pidl/lib/Parse/Pidl/Samba4/Python.pm +++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm @@ -1000,6 +1000,9 @@ sub ConvertObjectFromPythonLevel($$$$$$$$) # then this is where we would need to allocate it if ($l->{POINTER_TYPE} eq "ref") { $self->pidl("$var_name = talloc_ptrtype($mem_ctx, $var_name);"); + } elsif ($nl->{TYPE} eq "DATA" and Parse::Pidl::Typelist::is_scalar($nl->{DATA_TYPE}) + and not Parse::Pidl::Typelist::scalar_is_reference($nl->{DATA_TYPE})) { + $self->pidl("$var_name = talloc_ptrtype($mem_ctx, $var_name);"); } else { $self->pidl("$var_name = NULL;"); } -- 2.34.1