Issue #14036: return None when port in urlparse cross 65535
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index 4c57725..8a20756 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -97,9 +97,11 @@
         netloc = self.netloc.split('@')[-1].split(']')[-1]
         if ':' in netloc:
             port = netloc.split(':')[1]
-            return int(port, 10)
-        else:
-            return None
+            port = int(port, 10)
+            # verify legal port
+            if (0 <= port <= 65535):
+                return port
+        return None
 
 from collections import namedtuple