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
implicitly grow BytesMut; add BufMutExt::chain_mut #316
Conversation
This brings `BytesMut` in line with `Vec<u8>` behavior. In order to fix a test, `BufMutExt::chain_mut` is provided. Withou this, it is not possible to chain two `&mut [u8]`. Closes #170
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the bug in BytesMut::bytes_mut
that you fixed would previously return a slice that exceeded the length of the buffer. This seems like it could be a potential security issue — is there anything we need to do about that besides fixing the code?
Co-Authored-By: Eliza Weisman <eliza@buoyant.io>
@hawkw the bug was only on master for a bit (never released). |
This brings
BytesMut
in line withVec<u8>
behavior.Note this PR also fixes an existing bug in
BytesMut::bytes_mut
that exposes invalid slices.In order to fix a test,
BufMutExt::chain_mut
is provided. Withou this,it is not possible to chain two
&mut [u8]
.Closes #170