git.samba.org
/
jra
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0159c48
)
ldb: Check result of py_ldb_msg_keys()
author
Jo Sutton
<josutton@catalyst.net.nz>
Thu, 18 Apr 2024 00:47:28 +0000
(12:47 +1200)
committer
Jo Sutton
<jsutton@samba.org>
Sun, 21 Apr 2024 22:10:35 +0000
(22:10 +0000)
Passing NULL into PyObject_GetIter() can cause a segmentation fault.
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c
patch
|
blob
|
history
diff --git
a/lib/ldb/pyldb.c
b/lib/ldb/pyldb.c
index f416bfe6d5d70551f1c3d04c4abc4e8e398e9429..d54a952ac011138115035c414d1655f2f2caac52 100644
(file)
--- a/
lib/ldb/pyldb.c
+++ b/
lib/ldb/pyldb.c
@@
-4143,6
+4143,9
@@
static PyObject *py_ldb_msg_iter(PyObject *self)
PyObject *list, *iter;
list = py_ldb_msg_keys(self, NULL);
+ if (list == NULL) {
+ return NULL;
+ }
iter = PyObject_GetIter(list);
Py_DECREF(list);
return iter;