Notes
This function is in beta test. Please help improve it in the issues
here.
Hints
Your answer may be identical to the JOJ answer in the first several lines.
However, the main problem you meet now is Runtime Error. 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
mumsh $ ================================================================= ==84514==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6140000003d0 at pc 0x000000515a81 bp 0x7ffffe59a3c0 sp 0x7ffffe59a3b8 READ of size 8 at 0x6140000003d0 thread T0 #0 0x515a80 (/out/package/mumsh_memory_check+0x515a80) #1 0x515f6f (/out/package/mumsh_memory_check+0x515f6f) #2 0x516dad (/out/package/mumsh_memory_check+0x516dad) #3 0x5172f9 (/out/package/mumsh_memory_check+0x5172f9) #4 0x7fa476de2b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #5 0x41cd09 (/out/package/mumsh_memory_check+0x41cd09) 0x6140000003d0 is located 0 bytes to the right of 400-byte region [0x614000000240,0x6140000003d0) allocated by thread T0 here: #0 0x4dcbc0 (/out/package/mumsh_memory_check+0x4dcbc0) #1 0x517119 (/out/package/mumsh_memory_check+0x517119) #2 0x7fa476de2b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/package/mumsh_memory_check+0x515a80)
JOJ Answer
mumsh $ mumsh $ /out/package mumsh $ 1.txt driver mumsh mumsh_memory_check mumsh $ exit