summaryrefslogtreecommitdiffstats
path: root/source/python
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-02-18 01:09:19 +0000
committerMartin Pool <mbp@samba.org>2003-02-18 01:09:19 +0000
commitfe449328b226a33ad1c64e087fe63e79f90ab4ac (patch)
tree2248d11e53ec9ff9c4fca9f9d234225fceb6f7b2 /source/python
parentbb095dc28d8369457286225ac63e03070889f394 (diff)
downloadsamba-fe449328b226a33ad1c64e087fe63e79f90ab4ac.tar.gz
samba-fe449328b226a33ad1c64e087fe63e79f90ab4ac.tar.xz
samba-fe449328b226a33ad1c64e087fe63e79f90ab4ac.zip
Check return code from string_to_sid.
Diffstat (limited to 'source/python')
-rw-r--r--source/python/py_lsa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/python/py_lsa.c b/source/python/py_lsa.c
index 31706af6840..22db29665a0 100644
--- a/source/python/py_lsa.c
+++ b/source/python/py_lsa.c
@@ -235,7 +235,10 @@ static PyObject *lsa_lookup_sids(PyObject *self, PyObject *args,
for (i = 0; i < num_sids; i++) {
PyObject *obj = PyList_GetItem(py_sids, i);
- string_to_sid(&sids[i], PyString_AsString(obj));
+ if (!string_to_sid(&sids[i], PyString_AsString(obj))) {
+ PyErr_SetString(PyExc_ValueError, "string_to_sid failed");
+ return NULL;
+ }
}
} else {
@@ -245,7 +248,10 @@ static PyObject *lsa_lookup_sids(PyObject *self, PyObject *args,
num_sids = 1;
sids = (DOM_SID *)talloc(hnd->mem_ctx, sizeof(DOM_SID));
- string_to_sid(&sids[0], PyString_AsString(py_sids));
+ if (!string_to_sid(&sids[0], PyString_AsString(py_sids))) {
+ PyErr_SetString(PyExc_ValueError, "string_to_sid failed");
+ return NULL;
+ }
}
ntstatus = cli_lsa_lookup_sids(hnd->cli, hnd->mem_ctx, &hnd->pol,