summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2014-03-20 17:13:28 +0000
committerJim Ingham <jingham@apple.com>2014-03-20 17:13:28 +0000
commite1c34bf380e727e400de7b56652607db4bd92753 (patch)
tree0c23a54e369b6d11bd4367e0a93db92faa6faa4d
parent7ac51493d6b892e8e27df8109b7855176c9d0246 (diff)
downloadbcm5719-llvm-e1c34bf380e727e400de7b56652607db4bd92753.tar.gz
bcm5719-llvm-e1c34bf380e727e400de7b56652607db4bd92753.zip
Guard against reading from host address of 0 in getting the data from a Value.
llvm-svn: 204359
-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