Notes
This function is in beta test. Please help improve it in the issues
here.
$ ./ex3_memory_check rand_char*.txt rand main.c:148:13: runtime error: index 2049 out of bounds for type 'char *[2049]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.c:148:13 in ================================================================= ==29493==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc5fdc3578 at pc 0x0000005174db bp 0x7ffc5fdbec90 sp 0x7ffc5fdbec88 WRITE of size 8 at 0x7ffc5fdc3578 thread T0 #0 0x5174da (/out/package/ex3_memory_check+0x5174da) #1 0x517ed8 (/out/package/ex3_memory_check+0x517ed8) #2 0x7f838c1edb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #3 0x41cac9 (/out/package/ex3_memory_check+0x41cac9) Address 0x7ffc5fdc3578 is located in stack of thread T0 at offset 18648 in frame #0 0x516d5f (/out/package/ex3_memory_check+0x516d5f) This frame has 5 object(s): [32, 40) 'temp' [64, 2113) 'task' [2256, 18648) 'content' <== Memory access at offset 18648 overflows this variable [18912, 27108) 'a' [27376, 43768) '
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
Program exit with non zero value 1!
JOJ Answer
Correct!