1
Fork 0

Fix possible soundness issue in ensure_subset_of

This commit is contained in:
dylni 2021-01-18 09:22:17 -05:00
parent 9d29793614
commit cb647f3e8e
8 changed files with 112 additions and 110 deletions

View file

@ -1650,7 +1650,7 @@ impl<T, A: Allocator> Vec<T, A> {
// the hole, and the vector length is restored to the new length.
//
let len = self.len();
let Range { start, end } = range.ensure_subset_of(..len);
let Range { start, end } = Range::ensure_subset_of(range, ..len);
unsafe {
// set self.vec length's to start, to be safe in case Drain is leaked