Include variables touched by tainted functions

pull/1757/head
webthethird 2 years ago
parent 317af452ad
commit 9f4be7d7fb
  1. 5
      slither/utils/upgradeability.py

@ -105,7 +105,10 @@ def compare(v1: Contract, v2: Contract) -> dict:
written_by = v2.get_functions_writing_to_variable(var) written_by = v2.get_functions_writing_to_variable(var)
if v1.get_state_variable_from_name(var.name) is None: if v1.get_state_variable_from_name(var.name) is None:
results["new-variables"].append(var) results["new-variables"].append(var)
elif any(func in read_by or func in written_by for func in new_modified_functions): elif any(
func in read_by or func in written_by
for func in new_modified_functions + results["tainted-functions"]
):
results["tainted-variables"].append(var) results["tainted-variables"].append(var)
return results return results

Loading…
Cancel
Save