Skip to content
Snippets Groups Projects
Unverified Commit 78a85b69 authored by Vincent Brillault's avatar Vincent Brillault
Browse files

string_load: fix NoneType exceptions (no data at addr)

parent b57f64c5
No related branches found
No related tags found
No related merge requests found
......@@ -83,11 +83,15 @@ def check_string(start, length):
end = start.add(length-1)
if not range_printable(start, end):
return False
datatype_name = 'None'
data = listing.getDataAt(start)
datatype = data.getDataType().getName()
if datatype != 'string':
if data is not None:
datatype = data.getDataType()
if datatype is not None:
datatype_name = datatype.getName()
if datatype_name != 'string':
newStr = makeString(start, length, end)
print("Found string not seen before (was %s) at %s of len %s: %s" % (datatype, start, length, newStr))
print("Found string not seen before (was %s) at %s of len %s: %s" % (datatype_name, start, length, newStr))
return True
data_len = data.getLength()
if data_len > length:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment