llvm-project/lldb/source/Plugins/Process/minidump
Raphael Isemann acc48f3e1d 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

llvm-svn: 323181
2018-01-23 08:04:27 +00:00
..
CMakeLists.txt [CMake] [3/4] Update a batch of plugins 2017-01-31 22:29:11 +00:00
MinidumpParser.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
MinidumpParser.h Move ArchSpec to the Utility module 2017-11-13 16:16:33 +00:00
MinidumpTypes.cpp Prevent unaligned memory read in parseMinidumpString 2018-01-23 08:04:27 +00:00
MinidumpTypes.h Rename Error -> Status. 2017-05-12 04:51:55 +00:00
NtStructures.h Minidump plugin: Adding ProcessMinidump, ThreadMinidump and register the plugin in SystemInitializerFull 2016-10-31 15:35:18 +00:00
ProcessMinidump.cpp Rename Error -> Status. 2017-05-12 04:51:55 +00:00
ProcessMinidump.h Re-land r313210 - Fix for bug 34532 - A few rough corners related to post-mortem debugging (core/minidump) 2017-09-19 18:07:33 +00:00
RegisterContextMinidump_x86_32.cpp Move DataBuffer / DataExtractor and friends from Core -> Utility. 2017-03-04 01:30:05 +00:00
RegisterContextMinidump_x86_32.h Minidump plugin: Adding x86_32 register context converter 2016-10-31 15:26:44 +00:00
RegisterContextMinidump_x86_64.cpp Move DataBuffer / DataExtractor and friends from Core -> Utility. 2017-03-04 01:30:05 +00:00
RegisterContextMinidump_x86_64.h Minidump plugin: Adding x86_32 register context converter 2016-10-31 15:26:44 +00:00
ThreadMinidump.cpp elf-core: Convert remaining register context to use register set maps 2017-11-28 11:10:23 +00:00
ThreadMinidump.h Fix for bug 34510 - Minidump target does not resolve new symbols correctly 2017-09-07 18:29:48 +00:00