libcli/pysecurity: use pytalloc_get_name to avoid NULL deref
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 9 Jul 2019 09:45:03 +0000 (09:45 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 22 Jul 2019 22:20:25 +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>
libcli/security/pysecurity.c

index 86b2cc893aac87e8f19a6546e2f28d634a8000cf..38d502afb61f4c864a4ceb35ed497182168b90fe 100644 (file)
@@ -48,7 +48,7 @@ static PyObject *py_se_access_check(PyObject *module, PyObject *args, PyObject *
        if (!security_descriptor) {
                PyErr_Format(PyExc_TypeError,
                             "Expected dcerpc.security.descriptor for security_descriptor argument got  %s",
-                            talloc_get_name(pytalloc_get_ptr(py_sec_desc)));
+                            pytalloc_get_name(py_sec_desc));
                return NULL;
        }
 
@@ -56,7 +56,7 @@ static PyObject *py_se_access_check(PyObject *module, PyObject *args, PyObject *
        if (!security_token) {
                PyErr_Format(PyExc_TypeError,
                             "Expected dcerpc.security.token for token argument, got %s",
-                            talloc_get_name(pytalloc_get_ptr(py_security_token)));
+                            pytalloc_get_name(py_sec_desc));
                return NULL;
        }