Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
993ac924
Commit
993ac924
authored
Sep 03, 2019
by
Steve Dower
Committed by
GitHub
Sep 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
parent
0cf832a9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
Misc/NEWS.d/next/Windows/2019-09-03-11-47-37.bpo-38020.xFZ2j0.rst
...S.d/next/Windows/2019-09-03-11-47-37.bpo-38020.xFZ2j0.rst
+2
-0
Modules/posixmodule.c
Modules/posixmodule.c
+2
-2
No files found.
Misc/NEWS.d/next/Windows/2019-09-03-11-47-37.bpo-38020.xFZ2j0.rst
0 → 100644
View file @
993ac924
Fixes potential crash when calling :func:`os.readlink` (or indirectly
through :func:`~os.path.realpath`) on a file that is not a supported link.
Modules/posixmodule.c
View file @
993ac924
...
...
@@ -7818,7 +7818,7 @@ os_readlink_impl(PyObject *module, path_t *path, int dir_fd)
HANDLE
reparse_point_handle
;
char
target_buffer
[
_Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE
];
_Py_REPARSE_DATA_BUFFER
*
rdb
=
(
_Py_REPARSE_DATA_BUFFER
*
)
target_buffer
;
PyObject
*
result
;
PyObject
*
result
=
NULL
;
/* First get a handle to the reparse point */
Py_BEGIN_ALLOW_THREADS
...
...
@@ -7872,7 +7872,7 @@ os_readlink_impl(PyObject *module, path_t *path, int dir_fd)
name
[
1
]
=
L'\\'
;
}
result
=
PyUnicode_FromWideChar
(
name
,
nameLen
);
if
(
path
->
narrow
)
{
if
(
result
&&
path
->
narrow
)
{
Py_SETREF
(
result
,
PyUnicode_EncodeFSDefault
(
result
));
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment