PSStyle: validate background index against BackgroundColorMap (#27106)

This commit is contained in:
cui
2026-03-31 10:08:09 -07:00
committed by GitHub
parent 79526d2460
commit 27c53eaf45
@@ -892,7 +892,7 @@ namespace System.Management.Automation
throw new ArgumentOutOfRangeException(paramName: nameof(foregroundColor));
}
if (backIndex < 0 || backIndex >= ForegroundColorMap.Length)
if (backIndex < 0 || backIndex >= BackgroundColorMap.Length)
{
throw new ArgumentOutOfRangeException(paramName: nameof(backgroundColor));
}