Notes
This function is in beta test. Please help improve it in the issues
here.
$ ./ex3_memory_check rand_double.txt rand main.c:164:13: runtime error: index 2049 out of bounds for type 'double [2049]' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior main.c:164:13 in ================================================================= ==28034==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd0c76fbd8 at pc 0x0000005174e3 bp 0x7ffd0c7650d0 sp 0x7ffd0c7650c8 WRITE of size 8 at 0x7ffd0c76fbd8 thread T0 #0 0x5174e2 (/out/package/ex3_memory_check+0x5174e2) #1 0x517ed8 (/out/package/ex3_memory_check+0x517ed8) #2 0x7f468630eb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #3 0x41cac9 (/out/package/ex3_memory_check+0x41cac9) Address 0x7ffd0c76fbd8 is located in stack of thread T0 at offset 43768 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' [18912, 27108) 'a' [27376, 43768) 'b' <== Memory access at offset 43768 overflows this vari
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!