Notes
This function is in beta test. Please help improve it in the issues
here.
================================================================= ==62803==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffc83dedd70 at pc 0x0000004a8f89 bp 0x7ffc83ded350 sp 0x7ffc83decb00 WRITE of size 4 at 0x7ffc83dedd70 thread T0 #0 0x4a8f88 (/out/package/ex4+0x4a8f88) #1 0x4aa217 (/out/package/ex4+0x4aa217) #2 0x4aa2f6 (/out/package/ex4+0x4aa2f6) #3 0x515897 (/out/package/ex4+0x515897) #4 0x514fe7 (/out/package/ex4+0x514fe7) #5 0x7f9eee75cb96 (/lib/x86_64-linux-gnu/libc.so.6+0x21b96) #6 0x41cab9 (/out/package/ex4+0x41cab9) Address 0x7ffc83dedd70 is located in stack of thread T0 at offset 2032 in frame #0 0x5150ff (/out/package/ex4+0x5150ff) This frame has 4 object(s): [32, 2032) 'matrix' (line 8) <== Memory access at offset 2032 overflows this variable [2160, 2760) 'arow' (line 9) [2896, 3496) 'tmp' (line 14) [3632, 1003632) 'result' (line 15) HINT: this may be a false positive if your program uses some custom stack unwind mechani
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
STDOUT START 85 -97 112 -69 -65 21 123 57 -102 93 101 -24 75 102 -111 103 94 69 9 108 -50 28 178 165 -9 -62 -52 -67 22 -68 -112 61 150 -113 -109 35 166 -56 22 -44 54 143 -108 53 31 8 -25 121 -66 54 44 106 123 -164 -43 15 -73 120 -38 -46 27 0 147 -85 -38 -57 14 79 -29 -42 -13 -132 -20 118 65 -84 -95 -2 -4 -18 97 55 -18 -3 -74 -61 132 43 85 -65 -162 54 38 145 80 76 -2 -3 -120 29 35 87 72 31 127 -39 16 -165 -72 25 43 8 90 -14 32 44 -103 37 -77 8 -148 157 -46 -88 -19 -33 -148 28 -118 104 132 131 -99 -75 -53 -124 42 -36 65 -85 15 -102 -21 -66 9 64 154 33 -192 -92 3 40 30 -49 -4 -48 -89 108 110 -84 10 134 0 -65 59 -4 -84 119 138 188 -53 58 -17 -25 -11 -67 37 -33 75 -33 23 39 -2 -8 59 -37 106 -31 96 -2 3 29 -97 -7 -2 52 -27 33 -119 -24 -30 21 35 41 107 -16 80 -28 56 -81 -151 85 -8 170 104 -67 -28 146 -25 -116 44 -48 142 32 -104 -20 143 41 28 11 20 -77 -131 66 -105 -51 14 -20 86 96 10 113 -55 20 63 -4 41 -30 -119 107 66 32 52 -14 86 110 -38 74 -88 28 -171 94 16 -16 87 162 -25 -74 98 32 43 56 192 72 -129 85