mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 11:57:39 +08:00
Add a check for a null destination buffer in SBProcess::ReadMemory, and return an error if that happens. If a Python SB API script tries to allocate a huge amount of memory, the malloc done by the intermediate layers will fail and will hand a null pointer to ReadMemory. lldb will eventually crash trying to write in to that buffer. Also add a test that tries to allocate an impossibly large amount of memory, and hopefully should result in a failed malloc and hitting this error codepath. Differential Revision: https://reviews.llvm.org/D143012 rdar://104846609