Skip to content

Commit d1358f6

Browse files
jkoenigertiran
andauthored
fixup! fix(LDAPObject): Prevent memory errors in attrs_from_List
Co-authored-by: Christian Heimes <christian@python.org>
1 parent e18c567 commit d1358f6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/LDAPObject.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ attrs_from_List(PyObject *attrlist, char ***attrsp)
288288
if (seq == NULL)
289289
goto error;
290290

291-
len = PySequence_Fast_GET_SIZE(seq);
291+
len = PySequence_Size(seq);
292+
if (len == -1) {
293+
goto error;
294+
}
292295

293296
attrs = PyMem_NEW(char *, len + 1);
294297

0 commit comments

Comments
 (0)