diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-05-24 21:57:38 +0800 |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-05-24 21:57:38 +0800 |
commit | 4715ca560004b6df0d573084a07a9355b7ac189f (patch) | |
tree | d25915a6c31d286be00f876248c1e5d3a6fe7acd /Lib/urllib | |
parent | b95c63413d3ac5963187b6d528b1147229a1f190 (diff) | |
parent | 2fc5a5080923f243a78b13cca0fd09f8db26eff6 (diff) | |
download | cpython-git-4715ca560004b6df0d573084a07a9355b7ac189f.tar.gz |
Issue #14036: return None when port in urlparse cross 65535
Diffstat (limited to 'Lib/urllib')
-rw-r--r-- | Lib/urllib/parse.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index 92170ad0a2..528c0a7aaf 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -143,6 +143,9 @@ class _NetlocResultMixinBase(object): port = self._hostinfo[1] if port is not None: port = int(port, 10) + # Return None on an illegal port + if not ( 0 <= port <= 65535): + return None return port |