summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViktor Hofer <viktor.hofer@outlook.com>2017-03-21 20:36:25 +0100
committerDan Moseley <danmose@microsoft.com>2017-03-21 12:36:25 -0700
commite21d073e5e2b1d258cfef9111656d46884b242e7 (patch)
tree628e2823f867d29e301dbe153ede9b002a56084f
parentfc992064a8746119a5f153279838d0cd791fced7 (diff)
downloadcoreclr-e21d073e5e2b1d258cfef9111656d46884b242e7.tar.gz
coreclr-e21d073e5e2b1d258cfef9111656d46884b242e7.tar.bz2
coreclr-e21d073e5e2b1d258cfef9111656d46884b242e7.zip
System.IO.Path.IsPathRooted does not check if valid drive letter on Windows (#10323)
-rw-r--r--src/mscorlib/shared/System/IO/Path.Windows.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mscorlib/shared/System/IO/Path.Windows.cs b/src/mscorlib/shared/System/IO/Path.Windows.cs
index 0f8e3b39cc..d6f0c628c3 100644
--- a/src/mscorlib/shared/System/IO/Path.Windows.cs
+++ b/src/mscorlib/shared/System/IO/Path.Windows.cs
@@ -114,7 +114,7 @@ namespace System.IO
}
// Tests if the given path contains a root. A path is considered rooted
- // if it starts with a backslash ("\") or a drive letter and a colon (":").
+ // if it starts with a backslash ("\") or a valid drive letter and a colon (":").
public static bool IsPathRooted(string path)
{
if (path != null)
@@ -123,7 +123,7 @@ namespace System.IO
int length = path.Length;
if ((length >= 1 && PathInternal.IsDirectorySeparator(path[0])) ||
- (length >= 2 && path[1] == PathInternal.VolumeSeparatorChar))
+ (length >= 2 && PathInternal.IsValidDriveChar(path[0]) && path[1] == PathInternal.VolumeSeparatorChar))
return true;
}
return false;