Skip to content

Commit

Permalink
copy dict rather than reference
Browse files Browse the repository at this point in the history
  • Loading branch information
lawndoc committed Jul 17, 2024
1 parent 47f5667 commit 2e67940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions respotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def webhook_responder_alert(self, responder_ip):
with self.state_lock:
with open("state/state.json", "r+") as state_file:
state = json.load(state_file)
new_state = self.responder_alerts
new_state = self.responder_alerts.copy()
for ip in new_state:
new_state[ip] = new_state[ip].isoformat()
state["responder_alerts"] = new_state
Expand All @@ -142,7 +142,7 @@ def webhook_sniffer_alert(self, protocol, requester_ip, requested_hostname):
with self.state_lock:
with open("state/state.json", "r+") as state_file:
state = json.load(state_file)
new_state = self.vulnerable_alerts
new_state = self.vulnerable_alerts.copy()
for ip in new_state:
for protocol in new_state[ip]:
new_state[ip][protocol] = new_state[ip][protocol].isoformat()
Expand Down

0 comments on commit 2e67940

Please sign in to comment.