s3/smbd/py: avoid null deref with bad python arguments
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 9 Jul 2019 10:51:38 +0000 (22:51 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 22 Jul 2019 22:20:26 +0000 (22:20 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/smbd/pysmbd.c

index 199885e68017643565c3ff12ee37bc6267f1ad1a..082c2b44f94629b3ef9a774ccbe8cdb6e51768f3 100644 (file)
@@ -595,7 +595,7 @@ static PyObject *py_smbd_set_nt_acl(PyObject *self, PyObject *args, PyObject *kw
                if (!session_info) {
                        PyErr_Format(PyExc_TypeError,
                                     "Expected auth_session_info for session_info argument got %s",
-                                    talloc_get_name(pytalloc_get_ptr(py_session)));
+                                    pytalloc_get_name(py_session));
                        return NULL;
                }
        }
@@ -663,7 +663,7 @@ static PyObject *py_smbd_get_nt_acl(PyObject *self, PyObject *args, PyObject *kw
                                PyExc_TypeError,
                                "Expected auth_session_info for "
                                "session_info argument got %s",
-                               talloc_get_name(pytalloc_get_ptr(py_session)));
+                               pytalloc_get_name(py_session));
                        return NULL;
                }
        }