summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Core/Value.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index 9d42a377462..51a8c0334e0 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -579,7 +579,12 @@ Value::GetValueAsData (ExecutionContext *exe_ctx,
{
if (address_type == eAddressTypeHost)
{
- // The address is an address in this process, so just copy it
+ // The address is an address in this process, so just copy it.
+ if (address == 0)
+ {
+ error.SetErrorStringWithFormat("trying to read from host address of 0.");
+ return error;
+ }
memcpy (dst, (uint8_t*)NULL + address, byte_size);
}
else if ((address_type == eAddressTypeLoad) || (address_type == eAddressTypeFile))
OpenPOWER on IntegriCloud