News for hackers. Stuff that matters.
Re:Simple Linux kernel memory corruption bug can lead to com... by gpderetta on Wednesday October 20, 2021 @04:42AM (#28928290)
wouldn't compiling with _GLIBCXX_ASSERTIONS or the corresponding for your compiler of choice be a better solution? It will also catch quite a few more issues (dereferencing null smart pointers, empty optionals, etc.), while being still relatively lightweight.
Re:Simple Linux kernel memory corruption bug can lead to com... by throwaway81523 on Wednesday October 20, 2021 @05:07PM (#28936634)
Thanks, I didn't know (or didn't remember) about this, but it's not clear from the docs that it bounds checks []. I don't find it difficult to use .at(). I'll try the debug mode too, but when I bother writing something in C++ it's usually because I actually care about its speed, so I don't want the overhead to be too bad.

https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros...

Re:Simple Linux kernel memory corruption bug can lead to com... by pjmlp on Wednesday October 20, 2021 @07:54AM (#28929591)
Not the OP, that is my approach, keep on the bounds checking settings from VC++ also in release builds.

And before STL was a thing, all the custom types I had were bounds checked by default.