diff options
author | Steve Dower <steve.dower@python.org> | 2021-04-22 23:30:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 23:30:37 (GMT) |
commit | e07d8098892e85ecc56969d2c9a5afb3ea33ce8f (patch) | |
tree | a23679c0e3de83b4081f6100f585ffd516c05fd8 /Modules | |
parent | 4696f1285d83dd7b69f459c63e14080b1f87f797 (diff) | |
download | cpython-e07d8098892e85ecc56969d2c9a5afb3ea33ce8f.zip cpython-e07d8098892e85ecc56969d2c9a5afb3ea33ce8f.tar.gz cpython-e07d8098892e85ecc56969d2c9a5afb3ea33ce8f.tar.bz2 |
bpo-38222: Check specifically for a drive, not just a colon (GH-25540)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/posixmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c index 7a5a0e9..85e1e69 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1860,8 +1860,8 @@ attributes_from_dir(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *re while (--n > 0 && (filename[n] == L'\\' || filename[n] == L'/')) { ((LPWSTR)filename)[n] = L'\0'; } - if (!n || filename[n] == L':') { - // Nothing left te query + if (!n || (n == 1 && filename[1] == L':')) { + // Nothing left to query free((void *)filename); return FALSE; } |