mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.11] gh-102281: Fix potential nullptr dereference + use of uninitia… (#103040)
[3.11] gh-102281: Fix potential nullptr dereference + use of uninitialized memory (gh-102282)
(cherry picked from commit afa6092ee4)
This commit is contained in:
parent
e1094c6e6a
commit
b28f919007
3 changed files with 10 additions and 2 deletions
|
|
@ -452,7 +452,10 @@ getpath_realpath(PyObject *Py_UNUSED(self) , PyObject *args)
|
|||
if (s) {
|
||||
*s = L'\0';
|
||||
}
|
||||
path2 = _Py_normpath(_Py_join_relfile(path, resolved), -1);
|
||||
path2 = _Py_join_relfile(path, resolved);
|
||||
if (path2) {
|
||||
path2 = _Py_normpath(path2, -1);
|
||||
}
|
||||
PyMem_RawFree((void *)path);
|
||||
path = path2;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue