]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
pytest: bind to localhost
authorViktor Szakats <commit@vsz.me>
Tue, 9 Sep 2025 20:40:02 +0000 (22:40 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 9 Sep 2025 22:55:07 +0000 (00:55 +0200)
Pointed out by CodeQL

Fixes https://github.com/curl/curl/security/code-scanning/298

Closes #18506

tests/http/testenv/ports.py

index 97159eb0cc4b924b5b119e0292636c7ca7fba27e..f3d2348fa679e1c79d115d87c70cea76c4dbccc3 100644 (file)
@@ -41,7 +41,7 @@ def alloc_port_set(port_specs: Dict[str, int]) -> Dict[str, int]:
     for name, ptype in port_specs.items():
         try:
             s = socket.socket(type=ptype)
-            s.bind(('', 0))
+            s.bind(('127.0.0.1', 0))
             ports[name] = s.getsockname()[1]
             socks.append(s)
         except Exception as e: