bufio: Reader.UnreadByte after Discard silently corrupts input #48446
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
What did you do?
On a
bufio.Reader
, invokeReadByte
, thenDiscard
one or more bytes, thenUnreadByte
(https://play.golang.org/p/RTitxKuiikQ):What did you expect to see?
UnreadByte
afterDiscard
either restores the last discarded byte, or returns a non-nil error and does not modify the buffered data.What did you see instead?
UnreadByte
overwrites the last discarded byte with the last byte returned from the lastRead*
call.The text was updated successfully, but these errors were encountered: