[issue33016] nt._getfinalpathname may use uninitialized memory

2018-09-21 Thread Steve Dower
Change by Steve Dower : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-11 Thread Eryk Sun
Eryk Sun added the comment: > pathlib currently expects DOS paths only: it will strip '\\?\' > prefix in resolve() pathlib's unqualified conversion from the extended form to classic DOS form is a bug. The resolved path may be invalid as a classic DOS path. It may be too long, a DOS device na

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > We know that the path is valid because we have a handle (in this case the > file system ensures that no parent directory in the path can be unlinked or > renamed). Thank you for pointing this out. I erroneously stated that the length of the path could inc

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > unless users are not prepared to deal with it ARE prepared > What do you think about handling this failure by calling GetFullPathName > instead (e.g. "C:\Temp\NUL" => "\\.\NUL")? I think it would indeed be nice if pathlib handled such paths in its resolve(

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: > Because we only try VOLUME_NAME_DOS, this function always fails for a volume > that's not mounted as either a drive letter or a junction mount point. If a volume is not mounted, users have to use \\?\ or \\.\ either directly or indirectly via a symlink or

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: Leaving this open for commit review (and buildbots) for a little while, but then I'll close it if we're all good. -- assignee: -> steve.dower stage: patch review -> commit review ___ Python tracker

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: New changeset 32efcd13069a89abf007373274ee1bc0909d1996 by Steve Dower in branch '3.6': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6032) https://github.com/python/cpython/commit/32efcd13069a89abf007373274ee1bc0909d1996

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Alexey Izbyshev
Alexey Izbyshev added the comment: Copying the comment of @eryksun from PR 6010 for reference. Because we only try VOLUME_NAME_DOS, this function always fails for a volume that's not mounted as either a drive letter or a junction mount point. The error in this case is ERROR_PATH_NOT_FOUND. We

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread miss-islington
miss-islington added the comment: New changeset 8c163bbf370f6f6cedd2c07f7d54c9b36c97d8f2 by Miss Islington (bot) in branch '3.7': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (GH-6010) https://github.com/python/cpython/commit/8c163bbf370f6f6cedd2c07f7d54c9b36c9

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Change by Steve Dower : -- pull_requests: +5795 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread miss-islington
Change by miss-islington : -- pull_requests: +5794 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-08 Thread Steve Dower
Steve Dower added the comment: New changeset 3b20d3454e8082e07dba93617793de5dc9237828 by Steve Dower (Alexey Izbyshev) in branch 'master': bpo-33016: Fix potential use of uninitialized memory in nt._getfinalpathname (#6010) https://github.com/python/cpython/commit/3b20d3454e8082e07dba93617793

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-06 Thread Eryk Sun
Eryk Sun added the comment: The inconsistent use of VOLUME_NAME_NT and VOLUME_NAME_DOS was addressed incidentally in issue 29734, but that issue is primarily about the handle leaked when GetFinalPathNameByHandleW fails. That said, you've cleanly addressed the handle leak in your PR also. I pr

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-06 Thread Alexey Izbyshev
Change by Alexey Izbyshev : -- keywords: +patch pull_requests: +5775 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-l

[issue33016] nt._getfinalpathname may use uninitialized memory

2018-03-06 Thread Alexey Izbyshev
New submission from Alexey Izbyshev : The first call of GetFinalPathNameByHandleW requests the required buffer size for the NT path (VOLUME_NAME_NT), while the second call receives the DOS path (VOLUME_NAME_DOS) in the allocated buffer. Usually, NT paths are longer than DOS ones, for example: