s4/auth/py: avoid null deref with bad python arguments
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 9 Jul 2019 10:52:33 +0000 (22:52 +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>
source4/auth/pyauth.c

index 8d44b8572c25f40c54d526e41393d3374eda8867..4203692025bde26dd994c026bc9c53a5fba932e7 100644 (file)
@@ -76,7 +76,7 @@ static PyObject *py_copy_session_info(PyObject *module,
                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;
        }
 
@@ -258,7 +258,7 @@ static PyObject *py_session_info_fill_unix(PyObject *module,
        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;
        }