[Lldb-commits] [lldb] [lldb] Make ValueObjectDynamicValue::UpdateValue() point to a host b… (PR #125143)

via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 30 18:08:34 PST 2025


jimingham wrote:

I worry a bit about the fact that in the host case, GetValueAsData is going to end up calling:

      memcpy(dst, reinterpret_cast<uint8_t *>(address), byte_size);

where address is the host data buffer and byte_size is the size of the new dynamic type.  But in the case where the Value has data in the m_data_buffer, address points to a buffer.  The code makes sure that the destination buffer (pointed to by dst) is big enough to fit byte_size, but I don't see the guarantee that the original contents are not smaller than the new dynamic type byte size.
If we get that wrong, then we'll crash here or worse sample lldb internal memory and present that to the user as a value.
How do you know that can't happen? 

https://github.com/llvm/llvm-project/pull/125143


More information about the lldb-commits mailing list