Skip to content

Commit

Permalink
Ensure a single bad message does not cause a thread exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Jan 24, 2025
1 parent ba4c943 commit 345c4a0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wsdiscovery/threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ def _recvMessages(self):
time.sleep(0.01)
continue

env = parseSOAPMessage(data, addr[0])
try:
env = parseSOAPMessage(data, addr[0])
except Exception as e:
logger.debug("Failed to parse message from %s\n%s: %s", addr[0], data, e, exc_info=True)
env = None

if env is None: # fault or failed to parse
if self._capture:
Expand Down

0 comments on commit 345c4a0

Please sign in to comment.