Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

$ ./ex3_memory_check rand_char*.txt rand
reading rand_char*.txt
=================================================================
==10705==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x618001387fa1 at pc 0x0000004adafc bp 0x7fff29c1e6f0 sp 0x7fff29c1dea0
WRITE of size 1024 at 0x618001387fa1 thread T0
    #0 0x4adafb  (/out/package/ex3_memory_check+0x4adafb)
    #1 0x5184b1  (/out/package/ex3_memory_check+0x5184b1)
    #2 0x518715  (/out/package/ex3_memory_check+0x518715)
    #3 0x7f11953d6b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #4 0x41cac9  (/out/package/ex3_memory_check+0x41cac9)

0x618001387fa1 is located 0 bytes to the right of 801-byte region [0x618001387c80,0x618001387fa1)
allocated by thread T0 here:
    #0 0x4dc980  (/out/package/ex3_memory_check+0x4dc980)
    #1 0x518482  (/out/package/ex3_memory_check+0x518482)
    #2 0x518715  (/out/package/ex3_memory_check+0x518715)
    #3 0x7f11953d6b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: heap-buffer-overf

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, the main problem you meet now is Memory Exceeded. And the exit code of your program is 1, which should be 0.

Please double check your code to solve this problem and try again.

Your Answer

Program exit with non zero value 1!

JOJ Answer

Correct!