================================================================= ==25427==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000000030 at pc 0x00000050cad3 bp 0x7ffceba1fbb0 sp 0x7ffceba1fba8 READ of size 4 at 0x603000000030 thread T0 #0 0x50cad2 in dump /home/hongxu/tests/jsmn/example/jsondump.c:33:9 #1 0x50ca00 in dump /home/hongxu/tests/jsmn/example/jsondump.c:46:9 #2 0x50bed3 in main /home/hongxu/tests/jsmn/example/jsondump.c:120:4 #3 0x7fabab0cf1c0 in __libc_start_main /build/glibc-itYbWN/glibc-2.26/csu/../csu/libc-start.c:308 #4 0x41c5d9 in _start (/home/hongxu/tests/jsmn/jsondump+0x41c5d9) 0x603000000030 is located 0 bytes to the right of 32-byte region [0x603000000010,0x603000000030) allocated by thread T0 here: #0 0x4d1c20 in malloc (/home/hongxu/tests/jsmn/jsondump+0x4d1c20) #1 0x50bba6 in main /home/hongxu/tests/jsmn/example/jsondump.c:79:8 #2 0x7fabab0cf1c0 in __libc_start_main /build/glibc-itYbWN/glibc-2.26/csu/../csu/libc-start.c:308 SUMMARY: AddressSanitizer: heap-buffer-overflow /home/hongxu/tests/jsmn/example/jsondump.c:33:9 in dump Shadow bytes around the buggy address: 0x0c067fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c067fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c067fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c067fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c067fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c067fff8000: fa fa 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa 0x0c067fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c067fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb ==25427==ABORTING