Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions testping1.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
import subprocess
import subprocess # nosec B404
import concurrent.futures
import ipaddress
import logging
Expand Down Expand Up @@ -235,7 +235,7 @@ def is_reachable(ip, timeout=1):
try:
# πŸ›‘οΈ Sentinel: Add python-level timeout limit as defense-in-depth to prevent
# worker thread pool exhaustion if the underlying ping process hangs.
return subprocess.call(command, stdout=DEVNULL_FD, stderr=DEVNULL_FD, close_fds=True, timeout=timeout_val + 2) == 0
return subprocess.call(command, stdout=DEVNULL_FD, stderr=DEVNULL_FD, close_fds=True, timeout=timeout_val + 2) == 0 # nosec B603
except OSError:
# πŸ›‘οΈ Sentinel: Fail securely on command execution errors (like FileNotFoundError)
# to prevent unhandled exceptions crashing the worker thread pool and leaking stack traces.
Expand Down
Loading