Lucene search

K
osvGoogleOSV:RUSTSEC-2021-0046
HistoryFeb 17, 2021 - 12:00 p.m.

misc::vec_with_size() can drop uninitialized memory if clone panics

2021-02-1712:00:00
Google
osv.dev
10
misc
vec_with_size
uninitialized
memory
panic
undefined behavior
software

EPSS

0.005

Percentile

76.7%

misc::vec_with_size creates a vector of the provided size and immediately
calls vec.set_len(size) on it, initially filling it with uninitialized memory.
It then inserts elements using vec[i] = value.clone().

If the value.clone() call panics, uninitialized items in the vector will be
dropped leading to undefined behavior.

EPSS

0.005

Percentile

76.7%

Related for OSV:RUSTSEC-2021-0046