-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Here's what's wrong:
- is not checked to be
Lines 71 to 73 in b9cb855
PyObject *o = PyUnicode_DecodeFSDefault(val); PyStructSequence_SET_ITEM(v, i, o); } NULL, while it is possible - All errors here can overwrite each other:
Lines 88 to 104 in b9cb855
#define SETS(i,val) sets(v, i, val) SETS(setIndex++, p->pw_name); #if defined(HAVE_STRUCT_PASSWD_PW_PASSWD) && !defined(__ANDROID__) SETS(setIndex++, p->pw_passwd); #else SETS(setIndex++, ""); #endif PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid)); PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid)); #if defined(HAVE_STRUCT_PASSWD_PW_GECOS) SETS(setIndex++, p->pw_gecos); #else SETS(setIndex++, ""); #endif SETS(setIndex++, p->pw_dir); SETS(setIndex++, p->pw_shell); XDECREFused, whilevcannot beNULL:Line 109 in b9cb855
Py_XDECREF(v);
I will send a PR with the fix.
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error