3 matches found
prettytable-rs: Force cast a &Vec<T> to &[T] may lead to undefined behavior
In function Table::asref, a reference of vector is force cast to slice. There are multiple problems here: 1. To guarantee the size is correct, we have to first do Vec::shrinktofit. The function requires a mutable reference, so we have to force cast from immutable to mutable, which is undefined...
GHSA-GFGM-CHR3-X6PX prettytable-rs: Force cast a &Vec<T> to &[T] may lead to undefined behavior
In function Table::asref, a reference of vector is force cast to slice. There are multiple problems here: 1. To guarantee the size is correct, we have to first do Vec::shrinktofit. The function requires a mutable reference, so we have to force cast from immutable to mutable, which is undefined...
RUSTSEC-2022-0074 Force cast a &Vec<T> to &[T]
In function Table::asref, a reference of vector is force cast to slice. There are multiple problems here: 1. To guarantee the size is correct, we have to first do Vec::shrinktofit. The function requires a mutable reference, so we have to force cast from immutable to mutable, which is UB. 2. Even ...