ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000018 at pc 0x0000004053d9 bp 0x7f

ERROR: AddressSanitizer: heap-buffer-overflow on address 0x602000000018 at pc 0x0000004053d9 bp 0x7ffd7eb0be80 sp 0x7ffd7eb0be70 (leetcode)

出现上述类似错误,除了通常的数组溢出外;
在leetcode中,如果不将正确的返回数组的长度赋值给*returnSize,也会导致类似的错误,

*returnSize = 2;

你可能感兴趣的:(leetcode)