Lucene search

K
osvGoogleOSV:GHSA-JPWG-6GF5-5VH9
HistoryAug 25, 2021 - 8:54 p.m.

Out of bounds write in reorder

2021-08-2520:54:10
Google
osv.dev
4

0.002 Low

EPSS

Percentile

55.1%

swap_index takes an iterator and swaps the items with their corresponding indexes. It reserves capacity and sets the length of the vector based on the .len() method of the iterator.

If the len() returned by the iterator is larger than the actual number of elements yielded, then swap_index creates a vector containing uninitialized members. If the len() returned by the iterator is smaller than the actual number of members yielded, then swap_index can write out of bounds past its allocated vector.

As noted by the Rust documentation, len() and size_hint() are primarily meant for optimization and incorrect values from their implementations should not lead to memory safety violations.

CPENameOperatorVersion
reorderlt1.1.0

0.002 Low

EPSS

Percentile

55.1%

Related for OSV:GHSA-JPWG-6GF5-5VH9