pyldb: Don't segfault when invalid type is specified to as_sddl and from_sddl.
[ira/wip.git] / source4 / librpc / ndr / py_security.c
index 8ab790d4701b95af3c227e39f799daf16b99b819..02dc059f0587b9f735a1ef7517f9001e2cd7875f 100644 (file)
@@ -173,7 +173,7 @@ static PyObject *py_descriptor_from_sddl(PyObject *self, PyObject *args)
        PyObject *py_sid;
        struct dom_sid *sid;
 
-       if (!PyArg_ParseTuple(args, "sO", &sddl, &py_sid))
+       if (!PyArg_ParseTuple(args, "sO!", &sddl, &dom_sid_Type, &py_sid))
                return NULL;
 
        sid = py_talloc_get_ptr(py_sid);
@@ -195,7 +195,7 @@ static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *args)
        char *text;
        PyObject *ret;
 
-       if (!PyArg_ParseTuple(args, "|O", &py_sid))
+       if (!PyArg_ParseTuple(args, "|O!", &dom_sid_Type, &py_sid))
                return NULL;
 
        if (py_sid != Py_None)