Skip to content
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

Chain of two large (i.e. BytesMut) panics #550

Closed
jasl8r opened this issue Jun 10, 2022 · 2 comments
Closed

Chain of two large (i.e. BytesMut) panics #550

jasl8r opened this issue Jun 10, 2022 · 2 comments

Comments

@jasl8r
Copy link

jasl8r commented Jun 10, 2022

When chaining two spacious buffers, as in unbounded BytesMut, the remaining and remaining_mut fn both panic due to overflow when adding together the two child remaining. Obviously BytesMut acts as though it is infinite and this happens. I don't know if I'm dumb for chaining two infinite buffers, but it was just the simple way for me to start testing out Bytes and a Chain. The fix is of course simple, just change the unwrap to unwrap_or(usize::MAX).

@taiki-e
Copy link
Member

taiki-e commented Jun 11, 2022

This will be fixed by #488.

@taiki-e
Copy link
Member

taiki-e commented Jun 11, 2022

#488 merged

@taiki-e taiki-e closed this as completed Jun 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants