SubstreamReader fails when underlying stream returns only part of 4 byte header
leeview opened this issue · 2 comments
leeview commented
In src/Nerdbank.Streams/SubstreamReader.cs at line 106 there is a subtle bug there:
int bytesJustRead = this.underlyingStream.Read(this.intBuffer, 0, 4 - bytesRead);
should be
int bytesJustRead = this.underlyingStream.Read(this.intBuffer, bytesRead, 4 - bytesRead);
AArnott commented
Thanks for the report!
AArnott commented
The fix is shipped in 2.4.59