Improve reentrancy heuristic

pull/162/head
Josselin 6 years ago
parent e9c9476ea4
commit 2ac861f5e0
  1. 2
      slither/detectors/reentrancy/reentrancy_eth.py
  2. 2
      slither/detectors/reentrancy/reentrancy_read_before_write.py

@ -33,6 +33,8 @@ class ReentrancyEth(Reentrancy):
if node.context[self.KEY]['calls'] and node.context[self.KEY]['send_eth']:
read_then_written = []
for c in node.context[self.KEY]['calls']:
if c == node:
continue
read_then_written += [(v, node) for v in node.context[self.KEY]['written']
if v in node.context[self.KEY]['read_prior_calls'][c]]

@ -33,6 +33,8 @@ class ReentrancyReadBeforeWritten(Reentrancy):
if node.context[self.KEY]['calls'] and not node.context[self.KEY]['send_eth']:
read_then_written = []
for c in node.context[self.KEY]['calls']:
if c == node:
continue
read_then_written += [(v, node) for v in node.context[self.KEY]['written']
if v in node.context[self.KEY]['read_prior_calls'][c]]

Loading…
Cancel
Save