Skip to content

Commit

Permalink
# trying to read past EOF
Browse files Browse the repository at this point in the history
  • Loading branch information
Hawkynt committed Dec 15, 2024
1 parent 57e4e19 commit 0693ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Corlib.Extensions/System/IO/Stream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ static byte[] StructToBytes(TStruct value) {
public static void ReadBytes(this Stream @this, long position, byte[] buffer, SeekOrigin seekOrigin = SeekOrigin.Begin) {
Against.False(@this.CanRead);

_SeekToPositionAndCheck(@this, position, buffer.Length, seekOrigin);
_SeekToPositionAndCheck(@this, position, (int)Math.Min(buffer.Length, @this.Length - position), seekOrigin);
_ReadBytesToArraySeekable(@this, buffer, 0, buffer.Length);
}

Expand Down

0 comments on commit 0693ad0

Please sign in to comment.