5 ms·
By the sake of god, please stop to put C and C++ in the same basket when talking about security. It just show you do not know what you are talking about. Most
by adev_ 7y ago
By the sake of god, please stop to put C and C++ in the same basket when talking about security.
It just show you do not know what you are talking about.
Most security problems affecting C program DO NOT affect C++ programs.
Stack smash, vla abuse, string null termination problems, goto error control, double free corruption do NOT affect C++, they are C specific.
- z0mbie42 7y agoC++ is too large and huge to not shoot yourself in the foot (or of your user's) in one way or another.
- pjmlp 7y agoUnfortunately they surely do, because a large set of developers writes C++ code full of C idioms. Which is why Google has thrown out the towel and Android 11 will require hardware memory tagging for native code, and now everything is compiled with FORTIFY enabled. Also Microsoft research shows otherwise, https://msrc-blog.microsoft.com/2019/07/16/a-proactive-approach-to-more-secure-code/ https://msrc-blog.microsoft.com/2019/07/16/a-proactive-appro... > ~70% of the vulnerabilities Microsoft assigns a CVE each year continue to be memory safety issues So yeah, you are correct that C++ does offer the tools not to write C like security holes. Now you just need to convince a large spectrum of companies to actually stop doing C idioms while writing C++ code.
- adev_ 7y ago> Unfortunately they surely do, because a large set of developers writes C++ code full of C idioms. That's an other problem, not technical but educational. A lot of (older) programmer came to C++ passing by C and continue to use C in C++. That need time, education and guidelines to change that... a lot of time. Changing mindset and programmer education is sometimes harder than changing the program itself. > Now you just need to convince a large spectrum of companies to actually stop doing C idioms while writing C++ code. That is already ongoing. However do not forget that C++ has a bagage of 25 years of code pre-C++11 to upgrade before arriving there.
- pjmlp 7y agoWhile I mostly agree, plenty of companies aren't going to change their coding, and outsourcing practices, until they hurt their button line.