diff --git a/net/FlatBuffers/ByteBuffer.cs b/net/FlatBuffers/ByteBuffer.cs index 37779b593..7ca491dc5 100755 --- a/net/FlatBuffers/ByteBuffer.cs +++ b/net/FlatBuffers/ByteBuffer.cs @@ -129,8 +129,7 @@ namespace FlatBuffers private void AssertOffsetAndLength(int offset, int length) { if (offset < 0 || - offset >= _buffer.Length || - offset + length > _buffer.Length) + offset > _buffer.Length - length) throw new ArgumentOutOfRangeException(); }