Skip to content

Commit fe17548

Browse files
geor-genEgorBo
andauthored
Fix potential overflow (#120357)
* Fix potential overflow * Fixed misspelling * Length check change * Update src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.ManagedNtlm.cs Co-authored-by: Egor Bogatov <[email protected]> --------- Co-authored-by: Egor Bogatov <[email protected]>
1 parent 5b1583a commit fe17548

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.ManagedNtlm.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ private static ReadOnlySpan<byte> GetField(MessageField field, ReadOnlySpan<byte
333333

334334
private static unsafe void SetField(ref MessageField field, int length, int offset)
335335
{
336-
if (length > short.MaxValue)
336+
if (length is < 0 or > short.MaxValue)
337337
{
338338
throw new Win32Exception(NTE_FAIL);
339339
}

0 commit comments

Comments
 (0)