Panic in BytesMut::split_to when out of bounds (#252) (#253)

This commit is contained in:
Pavel Strakhov
2019-04-02 16:24:30 -07:00
committed by Carl Lerche
parent e0e30f00a1
commit d43e283e5e
2 changed files with 4 additions and 7 deletions
+2
View File
@@ -1265,6 +1265,8 @@ impl BytesMut {
///
/// Panics if `at > len`.
pub fn split_to(&mut self, at: usize) -> BytesMut {
assert!(at <= self.len());
BytesMut {
inner: self.inner.split_to(at),
}