-
-
Notifications
You must be signed in to change notification settings - Fork 852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix a few uses of DeflateStream.Read #1707
Conversation
The code is assuming it'll always return the requested amount unless it hits EOF, but that's not guaranteed.
Codecov Report
@@ Coverage Diff @@
## master #1707 +/- ##
=======================================
Coverage 84.33% 84.33%
=======================================
Files 816 816
Lines 35914 35921 +7
Branches 4179 4183 +4
=======================================
+ Hits 30288 30295 +7
Misses 4806 4806
Partials 820 820
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Ah fantastic! Thanks @stephentoub I'm not sure why you were getting test failures locally, (We have a few quirks in our setup (git submodules, LFS), were any specific errors being reported? CI seems to be working well anyway, as does the test run on my machine. |
Ah, I bet it's LFS. I'll try to fix it tomorrow. Thanks. |
Prerequisites
(68 of the 71 existing PngDecoder tests already fail when run against
master
, before and after this change, and I'm not sure if that's expected... presumably not? Maybe I'm just doing something wrong? I'm running them in test explorer in VS2022.)Description
The code is assuming Stream.Read always returns the requested number of bytes unless it hits EOF, but that's not guaranteed; the Stream.Read contract only guarantees at least 1 byte will be returned until EOF even if more are requested.
Fixes #1704
dotnet/runtime#55866