[Lldb-commits] [lldb] r204359 - Guard against reading from host address of 0 in getting the data from a Value.
jingham at apple.com
Thu Mar 20 10:13:28 PDT 2014
Date: Thu Mar 20 12:13:28 2014
New Revision: 204359
Guard against reading from host address of 0 in getting the data from a Value.
--- lldb/trunk/source/Core/Value.cpp (original)
+++ lldb/trunk/source/Core/Value.cpp Thu Mar 20 12:13:28 2014
@@ -579,7 +579,12 @@ Value::GetValueAsData (ExecutionContext
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))
More information about the lldb-commits