HomePhabricator

Prevent unaligned memory read in parseMinidumpString

Description

Prevent unaligned memory read in parseMinidumpString

Summary:
It's possible to hit an unaligned memory read when reading source_length as the data array is only aligned with 2 bytes (it's actually a UTF16 array). This patch memcpy's source_length into a local variable to prevent this:

MinidumpTypes.cpp:49:23: runtime error: load of misaligned address 0x7f0f4792692a for type 'const uint32_t' (aka 'const unsigned int'), which requires 4 byte alignment

Reviewers: dvlahovski, zturner, davide

Reviewed By: davide

Subscribers: davide, lldb-commits

Differential Revision: https://reviews.llvm.org/D42348

Details

Committed
teemperorJan 23 2018, 12:04 AM
Reviewer
davide
Differential Revision
D42348: Prevent unaligned memory read in parseMinidumpString
Parents
rL323180: Fix name of 'macOS' and add asteriks to brands, NFC.
Branches
Unknown
Tags
Unknown