mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-09 14:06:33 +00:00
Fix bad iOS module casting.
Change-Id: I0f8dcd867c56c4b1476c23d280e08448d2e90795 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2097177 Reviewed-by: Mark Mentovai <mark@chromium.org> Commit-Queue: Justin Cohen <justincohen@chromium.org>
This commit is contained in:
parent
b109e4ce38
commit
1d75af9bf5
@ -87,25 +87,26 @@ bool ModuleSnapshotIOS::FinishInitialization() {
|
|||||||
cmd_index <= header->ncmds && cumulative_cmd_size < header->sizeofcmds;
|
cmd_index <= header->ncmds && cumulative_cmd_size < header->sizeofcmds;
|
||||||
++cmd_index, cumulative_cmd_size += command->cmdsize) {
|
++cmd_index, cumulative_cmd_size += command->cmdsize) {
|
||||||
if (command->cmd == LC_SEGMENT_64) {
|
if (command->cmd == LC_SEGMENT_64) {
|
||||||
segment_command_64* segment =
|
const segment_command_64* segment =
|
||||||
reinterpret_cast<segment_command_64*>(&command);
|
reinterpret_cast<const segment_command_64*>(command);
|
||||||
if (strcmp(segment->segname, SEG_TEXT) == 0) {
|
if (strcmp(segment->segname, SEG_TEXT) == 0) {
|
||||||
size_ = segment->vmsize;
|
size_ = segment->vmsize;
|
||||||
}
|
}
|
||||||
} else if (command->cmd == LC_ID_DYLIB) {
|
} else if (command->cmd == LC_ID_DYLIB) {
|
||||||
dylib_command* dylib = reinterpret_cast<dylib_command*>(&command);
|
const dylib_command* dylib =
|
||||||
|
reinterpret_cast<const dylib_command*>(command);
|
||||||
dylib_version_ = dylib->dylib.current_version;
|
dylib_version_ = dylib->dylib.current_version;
|
||||||
} else if (command->cmd == LC_SOURCE_VERSION) {
|
} else if (command->cmd == LC_SOURCE_VERSION) {
|
||||||
source_version_command* source_version =
|
const source_version_command* source_version =
|
||||||
reinterpret_cast<source_version_command*>(&command);
|
reinterpret_cast<const source_version_command*>(command);
|
||||||
source_version_ = source_version->version;
|
source_version_ = source_version->version;
|
||||||
} else if (command->cmd == LC_UUID) {
|
} else if (command->cmd == LC_UUID) {
|
||||||
uuid_command* uuid = reinterpret_cast<uuid_command*>(&command);
|
const uuid_command* uuid = reinterpret_cast<const uuid_command*>(command);
|
||||||
uuid_.InitializeFromBytes(uuid->uuid);
|
uuid_.InitializeFromBytes(uuid->uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
command = reinterpret_cast<const load_command*>(
|
command = reinterpret_cast<const load_command*>(
|
||||||
reinterpret_cast<const uint8_t*>(command + command->cmdsize));
|
reinterpret_cast<const uint8_t*>(command) + command->cmdsize);
|
||||||
|
|
||||||
// TODO(justincohen): Warn-able things:
|
// TODO(justincohen): Warn-able things:
|
||||||
// - Bad Mach-O magic (and give up trying to process the module)
|
// - Bad Mach-O magic (and give up trying to process the module)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user