arendjr@programming.dev to Programming@programming.devEnglish · 24 hours agoFeds: Critical Software Must Drop C/C++ by 2026 or Face Riskthenewstack.ioexternal-linkmessage-square25fedilinkarrow-up171arrow-down17cross-posted to: tech
arrow-up164arrow-down1external-linkFeds: Critical Software Must Drop C/C++ by 2026 or Face Riskthenewstack.ioarendjr@programming.dev to Programming@programming.devEnglish · 24 hours agomessage-square25fedilinkcross-posted to: tech
minus-squarearendjr@programming.devOPlinkfedilinkarrow-up26·edit-218 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-down9·17 hours agoTo be fair, it’s entirely possible to make the same and very similar mistakes in Rust, too.
minus-squareGetOffMyLan@programming.devlinkfedilinkarrow-up6·edit-214 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.