News for hackers. Stuff that matters.
Re:Rust data structures with circular references (2021) by mandarax8 on Tuesday March 26, 2024 @03:44PM (#39832011)
How is reusing a freed index not a UAF? If I roll my own allocator I can still get UAFs even though the memory accessed is not yet free'd.
Re:Rust data structures with circular references (2021) by kelnos on Tuesday March 26, 2024 @08:28PM (#39834447)
Because that's not what "UAF" means. Also not what "freed" means.

To have a UAF, there has to be memory that is actually freed, and you have to attempt to access that memory. No memory is freed here (in the OP's implementation). Even if it was, at worst you'd get a panic for trying to access past the end of the Vec.

None of that is a UAF or a memory safety issue. It's just a logic bug.