diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-11-05 19:26:40 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-11-05 19:26:40 (GMT) |
commit | 570e371fd6e8615ece9b9e21fbe77149ebeb172e (patch) | |
tree | 2fcfc7f280f0039e94e89e1583fa69c33afbf36a /Modules | |
parent | 083a7a172b8c8888252d72031f21dcfea3c0d73f (diff) | |
download | cpython-570e371fd6e8615ece9b9e21fbe77149ebeb172e.zip cpython-570e371fd6e8615ece9b9e21fbe77149ebeb172e.tar.gz cpython-570e371fd6e8615ece9b9e21fbe77149ebeb172e.tar.bz2 |
Fix possible crashes in pwdmodule.c. (GH-10331)
"p" was not initialized if the first PyMem_RawRealloc() call failed.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/pwdmodule.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/pwdmodule.c b/Modules/pwdmodule.c index 1286e7d..fd11f84 100644 --- a/Modules/pwdmodule.c +++ b/Modules/pwdmodule.c @@ -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; } |