-
Notifications
You must be signed in to change notification settings - Fork 69
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
bufread::generic::Decoder: don't reinitialize on reader EOF #148
Conversation
0c6b4aa
to
c8bfeaf
Compare
To understand the issue I added an additional test assertion that I believe covers what this is meant to fix: bd6f0ae. If that looks like what you saw you can cherry-pick it to your branch. |
If `multiple_members` is enabled, the `bufread::generic::Decoder` will attempt to reinitialise the decoder inside `State::Flushing`, even if the reason it entered that state was due to the reader returning an EOF. This will result in an attempt to read past EOF, which is highly undesirable to say the least. To fix this, force `multiple_members` to `false` when we get an EOF condition from the reader.
c8bfeaf
to
90f95e4
Compare
@Nemo157 Yeah, that test looks good! Cherry-picked (and fixed the stupid compilation error :p) |
90f95e4
to
e724673
Compare
I fixed my tests formatting and just applied the same change to all the implementations. bors r+ |
148: bufread::generic::Decoder: don't reinitialize on reader EOF r=Nemo157 a=eeeeeta If `multiple_members` is enabled, the `bufread::generic::Decoder` will attempt to reinitialise the decoder inside `State::Flushing`, even if the reason it entered that state was due to the reader returning an EOF. This will result in an attempt to read past EOF, which is highly undesirable to say the least. To fix this, force `multiple_members` to `false` when we get an EOF condition from the reader. Co-authored-by: eta <github@eta.st> Co-authored-by: Wim Looman <git@nemo157.com>
Codecov Report
@@ Coverage Diff @@
## prīmum #148 +/- ##
==========================================
+ Coverage 78.00% 78.52% +0.52%
==========================================
Files 92 93 +1
Lines 2950 3041 +91
==========================================
+ Hits 2301 2388 +87
- Misses 649 653 +4
Continue to review full report at Codecov.
|
Published 0.3.14 |
If
multiple_members
is enabled, thebufread::generic::Decoder
willattempt to reinitialise the decoder inside
State::Flushing
, even ifthe reason it entered that state was due to the reader returning an EOF.
This will result in an attempt to read past EOF, which is highly
undesirable to say the least.
To fix this, force
multiple_members
tofalse
when we get an EOFcondition from the reader.