diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-11-05 12:26:40 -0700 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-11-05 21:26:40 +0200 |
commit | 570e371fd6e8615ece9b9e21fbe77149ebeb172e (patch) | |
tree | 2fcfc7f280f0039e94e89e1583fa69c33afbf36a | |
parent | 083a7a172b8c8888252d72031f21dcfea3c0d73f (diff) | |
download | cpython-git-570e371fd6e8615ece9b9e21fbe77149ebeb172e.tar.gz |
Fix possible crashes in pwdmodule.c. (GH-10331)
"p" was not initialized if the first PyMem_RawRealloc() call failed.
-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 1286e7d5ce..fd11f848b2 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; } |