Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==76000==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x611000002f80 at pc 0x0000004db7b2 bp 0x7fff63a2a130 sp 0x7fff63a298e0 READ of size 320 at 0x611000002f80 thread T0 #0 0x4db7b1 (/out/package/ex5+0x4db7b1) #1 0x515153 (/out/package/ex5+0x515153) #2 0x51605d (/out/package/ex5+0x51605d) #3 0x7fb642bf1b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #4 0x41ca39 (/out/package/ex5+0x41ca39) 0x611000002f80 is located 0 bytes to the right of 256-byte region [0x611000002e80,0x611000002f80) allocated by thread T0 here: #0 0x4dcd70 (/out/package/ex5+0x4dcd70) #1 0x5194fd (/out/package/ex5+0x5194fd) #2 0x516016 (/out/package/ex5+0x516016) #3 0x7fb642bf1b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) SUMMARY: AddressSanitizer: heap-buffer-overflow (/out/package/ex5+0x4db7b1) Shadow bytes around the buggy address: 0x0c227fff85a0: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c227fff85b0: f
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
92 -67 92 -67 16 92 -67 16 49 92 -67 16 49 92 -67 16 41 49 92 -67 16 41 49 53 92 -67 16 41 49 53 92 -67 16 41 49 53 92 -67 16 36 41 49 53 92 -67 16 36 41 49 53 92 -67 16 29 36 41 49 53 92 -67 16 29 36 41 49 53 92 -67 16 29 36 41 49 53 92 -67 16 29 36 41 49 53 60 92 -67 16 29 36 41 49 53 60 74 92 -67 16 29 36 41 49 53 60 74 81 92 -67 -41 16 29 36 41 49 53 60 74 81 92 -67 -41 16 29 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 1 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 -28 1 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 -28 1 16 29 31 36 41 49 53 60 74 81 92 96 -93 -88 -71 -67 -41 -28 1 16 29 31 36 41 49 53 60 74 81 92 96 -93 -88 -71 -67 -41 -28 1 16
JOJ Answer
92 -67 92 -67 16 92 -67 16 49 92 -67 16 49 92 -67 16 41 49 92 -67 16 41 49 53 92 -67 16 41 49 53 92 -67 16 41 49 53 92 -67 16 36 41 49 53 92 -67 16 36 41 49 53 92 -67 16 29 36 41 49 53 92 -67 16 29 36 41 49 53 92 -67 16 29 36 41 49 53 92 -67 16 29 36 41 49 53 60 92 -67 16 29 36 41 49 53 60 74 92 -67 16 29 36 41 49 53 60 74 81 92 -67 -41 16 29 36 41 49 53 60 74 81 92 -67 -41 16 29 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 1 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 -28 1 16 29 31 36 41 49 53 60 74 81 92 96 -88 -71 -67 -41 -28 1 16 29 31 36 41 49 53 60 74 81 92 96 -93 -88 -71 -67 -41 -28 1 16 29 31 36 41 49 53 60 74 81 92 96