Commit 570e371f authored by Zackery Spytz's avatar Zackery Spytz Committed by Serhiy Storchaka

Fix possible crashes in pwdmodule.c. (GH-10331)

"p" was not initialized if the first PyMem_RawRealloc() call failed.
parent 083a7a17
......@@ -145,6 +145,7 @@ pwd_getpwuid(PyObject *module, PyObject *uidobj)
while(1) {
buf2 = PyMem_RawRealloc(buf, bufsize);
if (buf2 == NULL) {
p = NULL;
nomem = 1;
break;
}
......@@ -227,6 +228,7 @@ pwd_getpwnam_impl(PyObject *module, PyObject *name)
while(1) {
buf2 = PyMem_RawRealloc(buf, bufsize);
if (buf2 == NULL) {
p = NULL;
nomem = 1;
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment