diff options
| author | Miss Skeleton (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-10-20 07:17:22 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-20 07:17:22 (GMT) |
| commit | aa7b03b31bf09b21a012b24e21977538e66b0172 (patch) | |
| tree | 6cbf49560820ab3c37a04cfcfd9d9a26f0bebe64 /Lib/urllib/request.py | |
| parent | 479553c7c11306a09ce34edb6ef208133b7b95fe (diff) | |
| download | cpython-aa7b03b31bf09b21a012b24e21977538e66b0172.zip cpython-aa7b03b31bf09b21a012b24e21977538e66b0172.tar.gz cpython-aa7b03b31bf09b21a012b24e21977538e66b0172.tar.bz2 | |
bpo-41471: Ignore invalid prefix lengths in system proxy settings on macOS (GH-22762) (GH-22773)
(cherry picked from commit 93a1ccabdede416425473329b8c718d507c55e29)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Diffstat (limited to 'Lib/urllib/request.py')
| -rw-r--r-- | Lib/urllib/request.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/urllib/request.py b/Lib/urllib/request.py index 2a3d715..a8c870b 100644 --- a/Lib/urllib/request.py +++ b/Lib/urllib/request.py @@ -2596,6 +2596,11 @@ def _proxy_bypass_macosx_sysconf(host, proxy_settings): mask = 8 * (m.group(1).count('.') + 1) else: mask = int(mask[1:]) + + if mask < 0 or mask > 32: + # System libraries ignore invalid prefix lengths + continue + mask = 32 - mask if (hostIP >> mask) == (base >> mask): |
