]> git.lizzy.rs Git - rust.git/commit
Don't do pointer arithmetic on pointers to deallocated memory
authorThe 8472 <git@infinite-source.de>
Mon, 16 Jan 2023 20:39:36 +0000 (21:39 +0100)
committerThe 8472 <git@infinite-source.de>
Tue, 17 Jan 2023 21:01:33 +0000 (22:01 +0100)
commit47014b1bb968be08923a670b1ebfe4deb4256601
treeacff87ab6d745ea43d48a0eaf2c7a907b893e185
parent481725984b4cd94ef5c00917b01c1771b6e5299c
Don't do pointer arithmetic on pointers to deallocated memory

vec::Splice can invalidate the slice::Iter inside vec::Drain.
So we replace them with dangling pointers which, unlike ones to
deallocated memory, are allowed.
library/alloc/src/vec/drain.rs
library/alloc/src/vec/splice.rs