]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
librpc/py_security: Don’t pass a NULL pointer to PyUnicode_FromString()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 20 Jul 2023 00:22:45 +0000 (12:22 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 8 Aug 2023 04:39:36 +0000 (04:39 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/librpc/ndr/py_security.c

index 217b7dc19d1403a7fc839730cf455030884aa805..74c73dd8dfed6639fd3925d04b4fece94dcfbd9c 100644 (file)
@@ -310,6 +310,10 @@ static PyObject *py_descriptor_as_sddl(PyObject *self, PyObject *args)
                sid = NULL;
 
        text = sddl_encode(NULL, desc, sid);
+       if (text == NULL) {
+               PyErr_SetString(PyExc_ValueError, "Unable to encode SDDL");
+               return NULL;
+       }
 
        ret = PyUnicode_FromString(text);