Skip to content

armgit / strix

Public Imported from GitHub
0

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

fix(runtime): also suppress OverflowError for non-finite STRIX_SANDBOX_CPUS

Ahmed Allam575e10a4048d
diff --git a/strix/runtime/docker_client.py b/strix/runtime/docker_client.py
index 3f364103..b393e6d2 100644
--- a/strix/runtime/docker_client.py
+++ b/strix/runtime/docker_client.py
@@ -78,7 +78,7 @@ def _apply_resource_limits(create_kwargs: dict[str, Any]) -> None:
cpus = os.environ.get("STRIX_SANDBOX_CPUS", "").strip()
if cpus:
- with contextlib.suppress(ValueError):
+ with contextlib.suppress(ValueError, OverflowError):
nano_cpus = int(float(cpus) * 1_000_000_000)
if nano_cpus > 0:
create_kwargs["nano_cpus"] = nano_cpus