Bug 1688393. Adds a control of negative values in

socket.recvfrom, which caused an ugly crash.
This commit is contained in:
Facundo Batista 2007-03-28 03:45:20 +00:00
parent b20c500251
commit 1fe9f968a2
2 changed files with 15 additions and 2 deletions

View file

@ -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):