$ valgrind ./overflow -n 11 ==26129== Memcheck, a memory error detector. ==26129== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==26129== Using LibVEX rev 1732, a library for dynamic binary translation. ==26129== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==26129== Using valgrind-3.2.3, a dynamic binary instrumentation framework. ==26129== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==26129== For more details, rerun with: -v ==26129== ==26129== Use of uninitialised value of size 8 ==26129== at 0x4E6880B: (within /lib64/libc-2.6.1.so) ==26129== by 0x4E6B134: vfprintf (in /lib64/libc-2.6.1.so) ==26129== by 0x4E72509: printf (in /lib64/libc-2.6.1.so) ==26129== by 0x4007C2: main (overflow.c:31) ==26129== ==26129== Conditional jump or move depends on uninitialised value(s) ==26129== at 0x4E68815: (within /lib64/libc-2.6.1.so) ==26129== by 0x4E6B134: vfprintf (in /lib64/libc-2.6.1.so) ==26129== by 0x4E72509: printf (in /lib64/libc-2.6.1.so) ==26129== by 0x4007C2: main (overflow.c:31) ==26129== ==26129== Conditional jump or move depends on uninitialised value(s) ==26129== at 0x4E6B1B1: vfprintf (in /lib64/libc-2.6.1.so) ==26129== by 0x4E72509: printf (in /lib64/libc-2.6.1.so) ==26129== by 0x4007C2: main (overflow.c:31) array[11] = 0 ==26129== ==26129== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 2 from 1) ==26129== malloc/free: in use at exit: 0 bytes in 0 blocks. ==26129== malloc/free: 0 allocs, 0 frees, 0 bytes allocated. ==26129== For counts of detected errors, rerun with: -v ==26129== All heap blocks were freed -- no leaks are possible.