Bugfix for ether_send module

pull/72/head
Bernhard Mueller 7 years ago
parent 36f055d1e4
commit 913401a27e
  1. 23
      mythril/analysis/modules/ether_send.py

@ -49,28 +49,18 @@ def execute(statespace):
m = re.search(r'storage_([a-z0-9_&^]+)', str(call.to)) m = re.search(r'storage_([a-z0-9_&^]+)', str(call.to))
if (m): if (m):
idx = m.group(1) idx = m.group(1)
try: func = statespace.find_storage_write(idx)
for s in statespace.sstors[idx]:
if s.tainted:
description += "a non-zero amount of Ether is sent to an address taken from storage slot " + str(idx) + "." \
" This storage slot can be written to by calling the function '" + s.node.function_name + "'.\n"
interesting = True
continue
except KeyError: if (func):
description += "\nThere is a check on storage index " + str(idx) + ". This storage slot can be written to by calling the function '" + func + "'.\n"
interesting = True
else:
logging.debug("[ETHER_SEND] No storage writes to index " + str(idx)) logging.debug("[ETHER_SEND] No storage writes to index " + str(idx))
break
if interesting: if interesting:
description += "Call value is " + str(call.value) + ".\n"
node = call.node node = call.node
can_solve = True can_solve = True
@ -86,8 +76,6 @@ def execute(statespace):
m = re.search(r'storage_([a-z0-9_&^]+)', str(constraint)) m = re.search(r'storage_([a-z0-9_&^]+)', str(constraint))
overwrite = False
if (m): if (m):
constrained = True constrained = True
@ -97,7 +85,6 @@ def execute(statespace):
if (func): if (func):
description += "\nThere is a check on storage index " + str(index) + ". This storage slot can be written to by calling the function '" + func + "'." description += "\nThere is a check on storage index " + str(index) + ". This storage slot can be written to by calling the function '" + func + "'."
overwrite = True
else: else:
logging.debug("[ETHER_SEND] No storage writes to index " + str(index)) logging.debug("[ETHER_SEND] No storage writes to index " + str(index))
can_solve = False can_solve = False

Loading…
Cancel
Save