llvm-project
bcc58833 - [asan] Describe the reported address if a range runs past a freed chunk (#243938)

Commit
2 days ago
[asan] Describe the reported address if a range runs past a freed chunk (#243938) If an access starts inside a heap chunk and runs past its end, the report describes the byte after the chunk. That is normally the first bad byte in a live chunk. In a freed chunk the first byte of the access is already bad, so describe that one. For `p = malloc(40); free(p); memcpy(dst, p + 8, 41);`: ``` ERROR: AddressSanitizer: heap-use-after-free on address 0x...18 before: 0x...38 is located 0 bytes after 40-byte region [0x...10,0x...38) after: 0x...18 is located 8 bytes inside of 40-byte region [0x...10,0x...38) ``` Reports about live chunks do not change. Assisted-by: Claude. I have reviewed every line of this PR.
Author
Parents
Loading