The branch, master has been updated
       via  fe9b12b2740 pidl/ndr/python: avoid memory errors in getsetters
       via  d6a82edd19b s4/messaging/py: don't DECREF borrowed references
       via  b136f153b83 ldb_dn: free dn components on explode failure
      from  5d4aa6e8670 s3:smbd: Fix sync dosmode fallback in async dosmode 
codepath

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


- Log -----------------------------------------------------------------
commit fe9b12b274028a1310ac6c59cc56ac36bb40ef5e
Author: Douglas Bagnall <[email protected]>
Date:   Thu Aug 1 23:29:55 2019 +0000

    pidl/ndr/python: avoid memory errors in getsetters
    
    This:
    
       $ python3 -c'from samba.dcerpc import lsa; x = lsa.EnumAccounts(); 
x.in_handle'
    
    should not raise a MemoryError, which is very unfriendly given that
    'x.in_handle' is just named, not called, as far as the user is
    concerned. Returning None is the proper thing.
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Noel Power <[email protected]>
    
    Autobuild-User(master): Noel Power <[email protected]>
    Autobuild-Date(master): Tue Aug  6 18:17:11 UTC 2019 on sn-devel-184

commit d6a82edd19b82d99401a27dbc6fe10121142e431
Author: Douglas Bagnall <[email protected]>
Date:   Thu Aug 1 16:02:05 2019 +1200

    s4/messaging/py: don't DECREF borrowed references
    
    This made Message.deregister() a decref machine, with talloc crashes
    and segfaults available thus:
    
        from samba import messaging
        m = messaging.Messaging()
        for i in range(20):
            m.deregister(m)
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Noel Power <[email protected]>

commit b136f153b83d80a91ec9d5350fdf08412d881964
Author: Douglas Bagnall <[email protected]>
Date:   Fri Mar 8 12:12:00 2019 +1300

    ldb_dn: free dn components on explode failure
    
    Signed-off-by: Douglas Bagnall <[email protected]>
    Reviewed-by: Noel Power <[email protected]>

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

Summary of changes:
 lib/ldb/common/ldb_dn.c              | 2 +-
 pidl/lib/Parse/Pidl/Samba4/Python.pm | 8 ++++++++
 source4/lib/messaging/pymessaging.c  | 2 --
 3 files changed, 9 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index eccb4a0ce4b..23a817edf65 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -340,7 +340,7 @@ static bool ldb_dn_explode(struct ldb_dn *dn)
        /* Components data space is allocated here once */
        data = talloc_array(dn->components, char, strlen(parse_dn) + 1);
        if (!data) {
-               return false;
+               goto failed;
        }
 
        p = parse_dn;
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm 
b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 97c417adf35..8d5de31e7bb 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -201,6 +201,14 @@ sub PythonElementGetSet($$$$$$) {
        $self->indent;
        $self->pidl("$cname *object = ($cname *)pytalloc_get_ptr(obj);");
        $self->pidl("PyObject *py_$e->{NAME};");
+       my $l = $e->{LEVELS}[0];
+       if ($l->{TYPE} eq "POINTER") {
+               $self->pidl("if ($varname == NULL) {");
+               $self->indent;
+               $self->pidl("Py_RETURN_NONE;");
+               $self->deindent;
+               $self->pidl("}");
+       }
        $self->ConvertObjectToPython("pytalloc_get_mem_ctx(obj)", $env, $e, 
$varname, "py_$e->{NAME}", "return NULL;");
        $self->pidl("return py_$e->{NAME};");
        $self->deindent;
diff --git a/source4/lib/messaging/pymessaging.c 
b/source4/lib/messaging/pymessaging.c
index 39c09a82403..e506d94f474 100644
--- a/source4/lib/messaging/pymessaging.c
+++ b/source4/lib/messaging/pymessaging.c
@@ -259,8 +259,6 @@ static PyObject *py_imessaging_deregister(PyObject *self, 
PyObject *args, PyObje
 
        imessaging_deregister(iface->msg_ctx, msg_type, callback);
 
-       Py_DECREF(callback);
-
        Py_RETURN_NONE;
 }
 


-- 
Samba Shared Repository

Reply via email to