Skip to content

Commit e07d809

Browse files
authored
bpo-38222: Check specifically for a drive, not just a colon (GH-25540)
1 parent 4696f12 commit e07d809

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/posixmodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1860,8 +1860,8 @@ attributes_from_dir(LPCWSTR pszFile, BY_HANDLE_FILE_INFORMATION *info, ULONG *re
18601860
while (--n > 0 && (filename[n] == L'\\' || filename[n] == L'/')) {
18611861
((LPWSTR)filename)[n] = L'\0';
18621862
}
1863-
if (!n || filename[n] == L':') {
1864-
// Nothing left te query
1863+
if (!n || (n == 1 && filename[1] == L':')) {
1864+
// Nothing left to query
18651865
free((void *)filename);
18661866
return FALSE;
18671867
}

0 commit comments

Comments
 (0)