Both e_shentsize and e_shstrndx are uint16, so the product elf_header.e_shentsize * elf_header.e_shstrndx can overflow the promoted type int (MAX_UINT16 * MAX_UINT16 > MAX_INT), which is undefined behavior. Not sure if it can affect any real cases or not, though. Cast e_shentsize to loff_t instead of e_shoff. This makes both multiplication and addition to use loff_t type. PiperOrigin-RevId: 511254775 Change-Id: I39c493bfb539cca6742aae807c50718d31e7c001
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| internal | Loading commit data... | |
| BUILD.bazel | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| failure_signal_handler.cc | Loading commit data... | |
| failure_signal_handler.h | Loading commit data... | |
| failure_signal_handler_test.cc | Loading commit data... | |
| leak_check.cc | Loading commit data... | |
| leak_check.h | Loading commit data... | |
| leak_check_fail_test.cc | Loading commit data... | |
| leak_check_test.cc | Loading commit data... | |
| stacktrace.cc | Loading commit data... | |
| stacktrace.h | Loading commit data... | |
| stacktrace_benchmark.cc | Loading commit data... | |
| stacktrace_test.cc | Loading commit data... | |
| symbolize.cc | Loading commit data... | |
| symbolize.h | Loading commit data... | |
| symbolize_darwin.inc | Loading commit data... | |
| symbolize_elf.inc | Loading commit data... | |
| symbolize_emscripten.inc | Loading commit data... | |
| symbolize_test.cc | Loading commit data... | |
| symbolize_unimplemented.inc | Loading commit data... | |
| symbolize_win32.inc | Loading commit data... |