When accessing a SectionRef::getContents() StringRef, the initial pointer is valid, and length is correct but the memory mapped at the pointer is not large enough for the length supplied. It's possible that the data pointer is misaligned. When accessing memory near the end of the section pointer it will causes a invalid access and crash.
Attached is a sample binary that causes a crash, the invalid section in the '.bss' in this case.
In order to reproduce: llvm-objdump -disassemble-all /path/to/attachment
halutil
(96176 bytes, application/octet-stream)When accessing a SectionRef::getContents() StringRef, the initial pointer is valid, and length is correct but the memory mapped at the pointer is not large enough for the length supplied. It's possible that the data pointer is misaligned. When accessing memory near the end of the section pointer it will causes a invalid access and crash.
Attached is a sample binary that causes a crash, the invalid section in the '.bss' in this case.
In order to reproduce: llvm-objdump -disassemble-all /path/to/attachment