Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==37256==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fff21e4e4a0 at pc 0x00000051d1fd bp 0x7fff21e3ab70 sp 0x7fff21e3ab68 WRITE of size 4 at 0x7fff21e4e4a0 thread T0 #0 0x51d1fc (/out/package/call_mem+0x51d1fc) #1 0x7fa29cbf0b96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #2 0x41d8f9 (/out/package/call_mem+0x41d8f9) Address 0x7fff21e4e4a0 is located in stack of thread T0 at offset 80032 in frame #0 0x51a15f (/out/package/call_mem+0x51a15f) This frame has 6 object(s): [32, 80032) 'customer_callin' (line 21) <== Memory access at offset 80032 overflows this variable [80288, 80320) 'num' (line 24) [80352, 80356) 'call_in_time' (line 30) [80368, 80372) 'call_duration' (line 30) [80384, 80416) 'call_name' (line 31) [80448, 80480) 'call_status' (line 31) HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext (longjmp and C++ exceptio
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
JOJ Answer
Starting tick #0 Starting tick #1 Starting tick #2 Starting tick #3 Starting tick #4 Starting tick #5 Call from gao a platinum member Answering call from gao Starting tick #6 Starting tick #7 Starting tick #8 Starting tick #9 Starting tick #10 Starting tick #11 Starting tick #12 Starting tick #13 Starting tick #14 Starting tick #15 Starting tick #16 Call from le a platinum member Answering call from le Starting tick #17 Starting tick #18 Starting tick #19 Starting tick #20 Starting tick #21 Starting tick #22 Call from Anthony a silver member Answering call from Anthony Starting tick #23 Starting tick #24 Starting tick #25 Starting tick #26 Starting tick #27 Starting tick #28 Starting tick #29 Starting tick #30 Starting tick #31 Starting tick #32 Starting tick #33 Starting tick #34 Call from Madison a regular member Answering call from Madison Starting tick #35 Starting tick #36 Starting tick #37 Starting tick #38 Starting tick #39 Starting tick #40 Starting tick #41 Call from yao a regular member Answering ca