From 166ec540133465102ae98258019203cf949b8a55 Mon Sep 17 00:00:00 2001 From: Charu Bassi Date: Mon, 28 Nov 2016 17:04:07 -0800 Subject: [PATCH] User should not be able to set MaxHistoryCount to unsupported value Validate that MaxHistoryCount lies within the range of 1-int.maxValue. --- PSReadLine/Cmdlets.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/PSReadLine/Cmdlets.cs b/PSReadLine/Cmdlets.cs index 8bad00c..001435e 100644 --- a/PSReadLine/Cmdlets.cs +++ b/PSReadLine/Cmdlets.cs @@ -461,6 +461,7 @@ namespace Microsoft.PowerShell internal SwitchParameter? _historySearchCursorMovesToEnd; [Parameter(ParameterSetName = "OptionsSet")] + [ValidateRange(1, int.MaxValue)] public int MaximumHistoryCount { get { return _maximumHistoryCount.GetValueOrDefault(); }