diff options
author | Georg Brandl <georg@python.org> | 2014-10-12 06:50:11 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-10-12 06:50:11 (GMT) |
commit | b3ac84322fe6dd542aa755779cdbc155edca8064 (patch) | |
tree | 6824b682fa75935c42a3faefc3e7abf11483a274 /Lib/test | |
parent | f84422da1dd651fc9f0b474f3cd955b6baf2bdcc (diff) | |
download | cpython-b3ac84322fe6dd542aa755779cdbc155edca8064.zip cpython-b3ac84322fe6dd542aa755779cdbc155edca8064.tar.gz cpython-b3ac84322fe6dd542aa755779cdbc155edca8064.tar.bz2 |
#16040: fix unlimited read from connection in nntplib.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_nntplib.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 7335b23..0875f71 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -563,6 +563,11 @@ class NNTPv1Handler: <a4929a40-6328-491a-aaaf-cb79ed7309a2@q2g2000vbk.googlegroups.com> <f30c0419-f549-4218-848f-d7d0131da931@y3g2000vbm.googlegroups.com> .""") + elif (group == 'comp.lang.python' and + date_str in ('20100101', '100101') and + time_str == '090000'): + self.push_lit('too long line' * 3000 + + '\n.') else: self.push_lit("""\ 230 An empty list of newsarticles follows @@ -1158,6 +1163,11 @@ class NNTPv1v2TestsMixin: self.assertEqual(cm.exception.response, "435 Article not wanted") + def test_too_long_lines(self): + dt = datetime.datetime(2010, 1, 1, 9, 0, 0) + self.assertRaises(nntplib.NNTPDataError, + self.server.newnews, "comp.lang.python", dt) + class NNTPv1Tests(NNTPv1v2TestsMixin, MockedNNTPTestsMixin, unittest.TestCase): """Tests an NNTP v1 server (no capabilities).""" |