From 5f59a9dfef45dbc37cfc215bd1f483a7c1ffdf75 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Fri, 8 Feb 2019 19:50:19 +0100 Subject: [PATCH] Fix length check in `PSSnapinQualifiedName.GetInstance()` (#8837) --- .../engine/MshSnapinQualifiedName.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs b/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs index e2efed9952..94231ed865 100644 --- a/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs +++ b/src/System.Management.Automation/engine/MshSnapinQualifiedName.cs @@ -68,7 +68,7 @@ namespace System.Management.Automation return null; PSSnapinQualifiedName result = null; string[] splitName = name.Split(Utils.Separators.Backslash); - if (splitName.Length < 0 || splitName.Length > 2) + if (splitName.Length == 0 || splitName.Length > 2) return null; result = new PSSnapinQualifiedName(splitName); // If the shortname is empty, then return null...