==127089== Memcheck, a memory error detector ==127089== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==127089== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info ==127089== Command: ./invalid_read-buffer_overread ==127089== ==127089== Invalid write of size 1 ==127089== at 0x40066B: repeat_char (invalid_read-buffer_overread.c:6) ==127089== by 0x4006E5: main (invalid_read-buffer_overread.c:17) ==127089== Address 0x5205043 is 0 bytes after a block of size 3 alloc'd ==127089== at 0x4C29F73: malloc (vg_replace_malloc.c:309) ==127089== by 0x400631: repeat_char (invalid_read-buffer_overread.c:2) ==127089== by 0x4006E5: main (invalid_read-buffer_overread.c:17) ==127089== ==127089== Invalid read of size 1 ==127089== at 0x4006BE: print_string (invalid_read-buffer_overread.c:11) ==127089== by 0x4006F5: main (invalid_read-buffer_overread.c:18) ==127089== Address 0x5205043 is 0 bytes after a block of size 3 alloc'd ==127089== at 0x4C29F73: malloc (vg_replace_malloc.c:309) ==127089== by 0x400631: repeat_char (invalid_read-buffer_overread.c:2) ==127089== by 0x4006E5: main (invalid_read-buffer_overread.c:17) ==127089== @@@==127089== ==127089== HEAP SUMMARY: ==127089== in use at exit: 0 bytes in 0 blocks ==127089== total heap usage: 1 allocs, 1 frees, 3 bytes allocated ==127089== ==127089== All heap blocks were freed -- no leaks are possible ==127089== ==127089== For lists of detected and suppressed errors, rerun with: -s ==127089== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)