mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-16 00:00:15 +02:00
Vec::advance_mut can advance past the end of the buffer (#108)
This commit is contained in:
+1
-1
@@ -713,7 +713,7 @@ impl BufMut for Vec<u8> {
|
||||
if cnt > remaining {
|
||||
// Reserve additional capacity, and ensure that the total length
|
||||
// will not overflow usize.
|
||||
self.reserve(cnt - remaining);
|
||||
self.reserve(cnt);
|
||||
}
|
||||
|
||||
self.set_len(len + cnt);
|
||||
|
||||
Reference in New Issue
Block a user