mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #16041: CVE-2013-1752: poplib: Limit maximum line lengths to 2048 to
prevent readline() calls from consuming too much memory. Patch by Jyrki Pulliainen.
This commit is contained in:
parent
72c98d3a76
commit
7e27abbb39
3 changed files with 19 additions and 2 deletions
|
@ -83,7 +83,7 @@ class DummyPOP3Handler(asynchat.async_chat):
|
|||
|
||||
def cmd_list(self, arg):
|
||||
if arg:
|
||||
self.push('+OK %s %s' %(arg, arg))
|
||||
self.push('+OK %s %s' % (arg, arg))
|
||||
else:
|
||||
self.push('+OK')
|
||||
asynchat.async_chat.push(self, LIST_RESP)
|
||||
|
@ -208,6 +208,10 @@ class TestPOP3Class(TestCase):
|
|||
foo = self.client.retr('foo')
|
||||
self.assertEqual(foo, expected)
|
||||
|
||||
def test_too_long_lines(self):
|
||||
self.assertRaises(poplib.error_proto, self.client._shortcmd,
|
||||
'echo +%s' % ((poplib._MAXLINE + 10) * 'a'))
|
||||
|
||||
def test_dele(self):
|
||||
self.assertOK(self.client.dele('foo'))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue