Files
rust/library/alloc
Matthew Demidoff 303dafdc11 Abort instead of unwinding out of an inconsistent BTreeMap::split_off
After the first move_suffix in Root::split_off, the source and result
trees share values through two temporarily invalid structures. If a
later key comparison panics, unwinding leaves the map with a stale
length over a partially detached tree, and consuming iteration then
double-frees the shared values, reachable from safe code.

Guard the descent loop with a mem::DropGuard that aborts on unwind,
armed before the first move_suffix and dismissed once the borders are
fixed.
2026-08-29 19:19:26 +02:00
..