You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The docs for BufMut::bytes_mut specifically allow for the method to return an empty slice . This should be changed so that the method may only return a 0-length slice if the buffer is exhausted. Otherwise, it's extremely easy to trigger infinite loops (for instance, the current implementation of BufMut::put_slice). I believe the stdlib Write trait puts similar restrictions on 0-length writes for similar reasons.
Likewise, BufMut::bytes_vec_mut should not return a 0-length vector unless the buffer is exhausted, and probably shouldn't return 0-length IoVecs ever.
The text was updated successfully, but these errors were encountered:
The docs for
BufMut::bytes_mut
specifically allow for the method to return an empty slice . This should be changed so that the method may only return a 0-length slice if the buffer is exhausted. Otherwise, it's extremely easy to trigger infinite loops (for instance, the current implementation ofBufMut::put_slice
). I believe the stdlibWrite
trait puts similar restrictions on 0-length writes for similar reasons.Likewise,
BufMut::bytes_vec_mut
should not return a 0-length vector unless the buffer is exhausted, and probably shouldn't return 0-lengthIoVec
s ever.The text was updated successfully, but these errors were encountered: