From 6cba05813819167736bd16bff3c7b3614bb24fc3 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 12 Sep 2021 12:30:17 +0200 Subject: [PATCH] Fix StreamShims Read method to not call itself. --- src/library/Syroot.Worms/Shims/System.IO.Stream.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/Syroot.Worms/Shims/System.IO.Stream.cs b/src/library/Syroot.Worms/Shims/System.IO.Stream.cs index febd22e..475761d 100644 --- a/src/library/Syroot.Worms/Shims/System.IO.Stream.cs +++ b/src/library/Syroot.Worms/Shims/System.IO.Stream.cs @@ -22,7 +22,7 @@ namespace System.IO public static int Read(this Stream stream, Span buffer) { byte[] bytes = new byte[buffer.Length]; - int bytesRead = stream.Read(bytes); + int bytesRead = stream.Read(bytes, 0, bytes.Length); bytes.AsSpan(0, bytesRead).CopyTo(buffer); return bytesRead; }