From 032a6ca98601fd1c80f335856015a17bec11ae8e Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Mon, 11 May 2026 04:09:52 +0700 Subject: [PATCH] stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py: Leading zeros in IPv4 addresses are no longer tolerated --- .../pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py b/stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py index f2d0766..3e1efc1 100644 --- a/stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py +++ b/stackoverflow/venv/lib/python3.6/site-packages/pip-19.0.3-py3.6.egg/pip/_vendor/ipaddress.py @@ -1291,6 +1291,11 @@ def _parse_octet(cls, octet_str): if len(octet_str) > 3: msg = "At most 3 characters permitted in %r" raise ValueError(msg % octet_str) + # Handle leading zeros as strict as glibc's inet_pton() + # See security bug bpo-36384 + if octet_str != "0" and octet_str[0] == "0": + msg = "Leading zeros are not permitted in %r" + raise ValueError(msg % octet_str) # Convert to integer (we know digits are legal) octet_int = int(octet_str, 10) # Any octets that look like they *might* be written in octal,