arendjr@programming.dev to Programming@programming.devEnglish · 14 hours agoFeds: Critical Software Must Drop C/C++ by 2026 or Face Riskthenewstack.ioexternal-linkmessage-square19fedilinkarrow-up162arrow-down18
arrow-up154arrow-down1external-linkFeds: Critical Software Must Drop C/C++ by 2026 or Face Riskthenewstack.ioarendjr@programming.dev to Programming@programming.devEnglish · 14 hours agomessage-square19fedilink
minus-squarearendjr@programming.devOPlinkfedilinkarrow-up20·edit-28 hours agoUsing smart pointers doesn’t eliminate the memory safety issue, it merely addresses one aspect of it. Even with smart pointers, nothing is preventing you from passing references and using them after they’re freed.
minus-squarerefalo@programming.devlinkfedilinkarrow-up2arrow-down4·7 hours agoTo be fair, it’s entirely possible to make the same and very similar mistakes in Rust, too.
minus-squareGetOffMyLan@programming.devlinkfedilinkarrow-up2·edit-24 hours agoI’m fairly sure use after free isn’t possible unless you explicitly use unsafe code right? It’s compiler enforced is the point.
Using smart pointers doesn’t eliminate the memory safety issue, it merely addresses one aspect of it. Even with smart pointers, nothing is preventing you from passing references and using them after they’re freed.
To be fair, it’s entirely possible to make the same and very similar mistakes in Rust, too.
I’m fairly sure use after free isn’t possible unless you explicitly use unsafe code right?
It’s compiler enforced is the point.