Re:What science can tell us about C and C++'s security (2020)
by UncleMeat on Tuesday August 03, 2021 @08:59AM
(#28048603)
Having no instances of new or delete does not, in any way, prevent the entire class of memory vulnerabilities. Running off the end of a buffer when processing untrusted data is just as easy. Heck, you can still absolutely get UAF issues even if you never allocate on the heap simply by holding a reference to a stack allocated object past its lifetime. Given how weird the rules around lifetime extension are, this can happy is really really subtle ways.
C++11 is not a safe language. Not even close. It is much much much better than what came before, but it is not safe.
C++11 is not a safe language. Not even close. It is much much much better than what came before, but it is not safe.