Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates-src > by-pkgid > db462f73ef48f9c252764ee92da0bff0 > files > 4

rust-1.28.0-1.2.mga6.src.rpm

Index: rustc-1.28.0-src/src/liballoc/slice.rs
===================================================================
--- rustc-1.28.0-src/src/liballoc/slice.rs
+++ rustc-1.28.0-src/src/liballoc/slice.rs	2018-09-27 13:56:39.086468770 +0200
@@ -417,7 +417,7 @@
         // and `rem` is the remaining part of `n`.
 
         // Using `Vec` to access `set_len()`.
-        let mut buf = Vec::with_capacity(self.len() * n);
+        let mut buf = Vec::with_capacity(self.len().checked_mul(n).expect("capacity overflow"));
 
         // `2^expn` repetition is done by doubling `buf` `expn`-times.
         buf.extend(self);