seriously.. I\'m an old hacker from the 80\'s and with some spare time on my hands thought I\'d \'C\' what the fuss is about
( my background is Forth, which does thi
Typically memory is allocated in 4 kB pages. Therefore there is some extra space after the last variable, and your buffer overrun goes undetected. If, however, there was another variable after your members
array and you wrote to members[4]
, that another variable would get corrupted.
Tools like valgrind and dmalloc are often used to detect buffer overruns. They work by allocating special guard regions around your variables and checking that no-one has written there.