3 ms·
And you can also open /proc/self/mem in a Rust program and overwrite whatever you want, including pointers. So?
by account42 2y ago
And you can also open /proc/self/mem in a Rust program and overwrite whatever you want, including pointers. So?
- Thiez 2y agoOne of those cases happens accidentally all the time (in more complex variants than the motivating example you responded to), the other never happens except on purpose. It's like complaining guard rails are pointless because people being launched with catapults might still fly over them and plunge to their deaths.
- consteval 2y agoI've never seen a nullptr somehow sneak into a reference. Never. What I have seen is automatic variables escaping their scope as a reference, which rust protects against. And is also much more dangerous, because dereferencing a nullptr is defined behavior on most platforms