diff options
author | Georg Brandl <georg@python.org> | 2014-09-30 12:45:39 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-09-30 12:45:39 (GMT) |
commit | eaca8616ab0e219ebb5cf37d495f4bf336ec0f5e (patch) | |
tree | b852d80486edb58b2fe1f67eba92547a319e391d /Lib/test | |
parent | 210ee47e3340d8e689d8cce584e7c918d368f16b (diff) | |
download | cpython-eaca8616ab0e219ebb5cf37d495f4bf336ec0f5e.zip cpython-eaca8616ab0e219ebb5cf37d495f4bf336ec0f5e.tar.gz cpython-eaca8616ab0e219ebb5cf37d495f4bf336ec0f5e.tar.bz2 |
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.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_poplib.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py index e3901b8..17b2261 100644 --- a/Lib/test/test_poplib.py +++ b/Lib/test/test_poplib.py @@ -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) @@ -204,6 +204,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')) |