From b25a6b12a94593dfdf502860abe133040e2b45ba Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 20 Jul 2023 12:22:45 +1200 Subject: [PATCH] =?UTF-8?q?librpc/py=5Fsecurity:=20Don=E2=80=99t=20pass=20?= =?UTF-8?q?a=20NULL=20pointer=20to=20PyUnicode=5FFromString()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source4/librpc/ndr/py_security.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source4/librpc/ndr/py_security.c b/source4/librpc/ndr/py_security.c index 217b7dc19d1..74c73dd8dfe 100644 --- a/source4/librpc/ndr/py_security.c +++ b/source4/librpc/ndr/py_security.c @@ -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);