summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorGary Lockyer <gary@catalyst.net.nz>2017-04-19 16:13:20 +1200
committerAndreas Schneider <asn@cryptomilk.org>2017-04-21 16:10:12 +0200
commit9342b3ebf7fe7b7565406bd9a606b6676c08b029 (patch)
tree4cc0cce6eeda264968d6990f15df7ad822c07049 /source4/librpc
parent375d772d04338861d92e683ae3c6c9d7ecb846ad (diff)
downloadsamba-9342b3ebf7fe7b7565406bd9a606b6676c08b029.tar.gz
pyrpc: Fix segfault in ClientConnection
Fix segfault when connecting over TCP, the endpoints list in dummy_table was not initialised this caused a segfault when attempting to connect over TCP. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlet <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Apr 21 16:10:12 CEST 2017 on sn-devel-144
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/pyrpc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c
index d4f13ba89f6..8b817b8b46d 100644
--- a/source4/librpc/rpc/pyrpc.c
+++ b/source4/librpc/rpc/pyrpc.c
@@ -293,6 +293,7 @@ static PyObject *dcerpc_interface_new(PyTypeObject *type, PyObject *args, PyObje
"binding", "syntax", "lp_ctx", "credentials", "basis_connection", NULL
};
static struct ndr_interface_table dummy_table;
+ static struct ndr_interface_string_array dummy_endpoints;
PyObject *args2 = Py_None;
PyObject *kwargs2 = Py_None;
@@ -316,6 +317,13 @@ static PyObject *dcerpc_interface_new(PyTypeObject *type, PyObject *args, PyObje
return NULL;
}
+ /*
+ * Initialise the endpoints list in dummy_table if required
+ */
+ if (dummy_table.endpoints == NULL) {
+ dummy_table.endpoints = &dummy_endpoints;
+ }
+
args2 = Py_BuildValue("(s)", binding_string);
if (args2 == NULL) {
return NULL;