Description
Hi there, we (Rust group @sslab-gatech) are scanning crates on crates.io for potential soundness bugs. We noticed some panic safety issues in the prune
and insert_item
functions:
Lines 163 to 174 in 8cc1e75
Lines 106 to 114 in 8cc1e75
This isn't too big of an issue right now because Topq
currently leaks memory when it goes out of scope because the queue is wrapped in MaybeUninit
. However, this can lead to double-frees if Topq
was updated to free the memory or if someone called these methods indirectly through their drop code.
Namely, if the user provided type T
panics during the drop_in_place
operations, the Topq
can be left in an inconsistent state and when it unwinds it can cause the same element to be dropped again.