Record Case Detail

Notes

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

Stderr

 pwd: /out/package
ppid: 19475
   1: WRITELN >
   2: WRITELN 1.txt echo 123
   3: WRITELN cat 1.txt
   4: WRITELN ls
   5: WRITELN exit

Hints

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

However, you will still get Wrong Answer because the complete output may be longer and there might be errors in the future lines.

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

Your Answer

mumsh $ =================================================================
==19477==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffe5046b058 at pc 0x00000051afee bp 0x7ffe5046aa90 sp 0x7ffe5046aa88
WRITE of size 8 at 0x7ffe5046b058 thread T0
    #0 0x51afed  (/out/package/mumsh_memory_check+0x51afed)
    #1 0x516c31  (/out/package/mumsh_memory_check+0x516c31)
    #2 0x5171f9  (/out/package/mumsh_memory_check+0x5171f9)
    #3 0x518439  (/out/package/mumsh_memory_check+0x518439)
    #4 0x518fe1  (/out/package/mumsh_memory_check+0x518fe1)
    #5 0x5194d1  (/out/package/mumsh_memory_check+0x5194d1)
    #6 0x7f116bb87b96  (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #7 0x41d1f9  (/out/package/mumsh_memory_check+0x41d1f9)

Address 0x7ffe5046b058 is located in stack of thread T0 at offset 88 in frame
    #0 0x51693f  (/out/package/mumsh_memory_check+0x51693f)

  This frame has 2 object(s):
    [32, 56) 'filename'
    [96, 2144) 'argv' <== Memory access at offset 88 underflows this variable
HINT: this

JOJ Answer

mumsh $ > mumsh $ 123
mumsh $ 1.txt
driver
mumsh
mumsh_memory_check
mumsh $ exit