diff --git a/src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.ManagedNtlm.cs b/src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.ManagedNtlm.cs index 147097e521c700..df2ffee5fe2910 100644 --- a/src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.ManagedNtlm.cs +++ b/src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.ManagedNtlm.cs @@ -333,7 +333,7 @@ private static ReadOnlySpan GetField(MessageField field, ReadOnlySpan short.MaxValue) + if (length is < 0 or > short.MaxValue) { throw new Win32Exception(NTE_FAIL); }