diff --git a/testping1.py b/testping1.py index c5a4bdc..3eab665 100644 --- a/testping1.py +++ b/testping1.py @@ -1,5 +1,5 @@ import os -import subprocess +import subprocess # nosec B404 import concurrent.futures import ipaddress import logging @@ -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.