Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
use out of range service/port values across all platforms
Some systems treat it as unsigned internally so ULONG_MAX+1 is needed, not LONG_MAX+1.
  • Loading branch information
gpshead authored Feb 13, 2023
commit 2ec83186afd94c587d912dab836d03297fb8c6ec
4 changes: 3 additions & 1 deletion Lib/test/test_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1605,9 +1605,11 @@ def test_getaddrinfo_overflow(self):
# Issue #30710: test that getaddrinfo does not raise OverflowError
import _testcapi
with self.assertRaises(socket.gaierror):
socket.getaddrinfo(None, _testcapi.LONG_MAX + 1)
socket.getaddrinfo(None, _testcapi.ULONG_MAX + 1)
with self.assertRaises(socket.gaierror):
socket.getaddrinfo(None, _testcapi.LONG_MIN - 1)
with self.assertRaises(socket.gaierror):
socket.getaddrinfo(None, -1)

def test_getnameinfo(self):
# only IP addresses are allowed
Expand Down