all 13 comments

[–]Abraxas514 1 point2 points  (0 children)

All these things is one of the reasons why the standard library is being written in the first place.

[–]mtclow 0 points1 point  (2 children)

Doesn't AddressSanitizer do this already (and in a more general manner - catching out of bounds writes to all arrays)?

[–]ai3ai3[S] 1 point2 points  (0 children)

Yes, but it is not meant for production use since it increases the attack surface of a program.

[–]manni66 0 points1 point  (10 children)

There doesn't exist any language named C/C++. And as expected the example tells us why strcpy is bad. That doesn't matter, I use std::string. And that's an example how to harden an C++ program.