You can compile with _GLIBCXX_DEBUG and _GLIBXX_DEBUG_PEDANTIC if you are using gcc. This will increase the validity of glibc claims if access is requested outside the boundaries.
Testing with valgrind :: memcheck will also show bad memory reads
source
share