diff --git a/src/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs b/src/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs index 16c8afe94aeb..bdb19d52059f 100644 --- a/src/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs +++ b/src/System.Text.Encoding.CodePages/src/System/Text/EncodingCharBuffer.cs @@ -90,7 +90,7 @@ internal unsafe bool AddChar(char ch1, char ch2, int numBytes) [System.Security.SecurityCritical] // auto-generated internal unsafe void AdjustBytes(int count) { - _bytes += count; + _bytes = unchecked(_bytes + count); } internal unsafe bool MoreData