mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
Bug 1688393. Adds a control of negative values in
socket.recvfrom, which caused an ugly crash.
This commit is contained in:
parent
b20c500251
commit
1fe9f968a2
2 changed files with 15 additions and 2 deletions
|
@ -597,6 +597,13 @@ class BasicUDPTest(ThreadedUDPSocketTest):
|
|||
def _testRecvFrom(self):
|
||||
self.cli.sendto(MSG, 0, (HOST, PORT))
|
||||
|
||||
def testRecvFromNegative(self):
|
||||
# Negative lengths passed to recvfrom should give ValueError.
|
||||
self.assertRaises(ValueError, self.serv.recvfrom, -1)
|
||||
|
||||
def _testRecvFromNegative(self):
|
||||
self.cli.sendto(MSG, 0, (HOST, PORT))
|
||||
|
||||
class TCPCloserTest(ThreadedTCPSocketTest):
|
||||
|
||||
def testClose(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue