]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38222: Check specifically for a drive, not just a colon (GH-25540)
authorSteve Dower <steve.dower@python.org>
Thu, 22 Apr 2021 23:30:37 +0000 (00:30 +0100)
committerGitHub <noreply@github.com>
Thu, 22 Apr 2021 23:30:37 +0000 (00:30 +0100)
Modules/posixmodule.c

index 7a5a0e9e8dd246d8099d10f083284feeb099d4cb..85e1e6976da16e4094dc2426d027373d92593b36 100644 (file)
@@ -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;
         }