summaryrefslogtreecommitdiffstats
path: root/Lib/imaplib.py
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2009-12-10 02:08:06 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2009-12-10 02:08:06 (GMT)
commite8dc258db5898f5bbeb60c6780d1a3cb41585afe (patch)
treed4da1ddcb5749df406772ed01141e386d736cf92 /Lib/imaplib.py
parente5fdedbeda147f3878f82349464f28f184c01658 (diff)
downloadcpython-e8dc258db5898f5bbeb60c6780d1a3cb41585afe.zip
cpython-e8dc258db5898f5bbeb60c6780d1a3cb41585afe.tar.gz
cpython-e8dc258db5898f5bbeb60c6780d1a3cb41585afe.tar.bz2
Merged revisions 76726-76727 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk The merge adds a test with an invalid rather than a missing line end, since the py3K code passed the original issue 5949 test. New test also by Scott Dial. ........ r76726 | r.david.murray | 2009-12-09 10:15:31 -0500 (Wed, 09 Dec 2009) | 6 lines Issue 5949: fixed IMAP4_SSL hang when the IMAP server response is missing proper end-of-line termination. Patch and tests by Scott Dial. The new tests include a test harness which will make it easier to add additional tests. ........ r76727 | r.david.murray | 2009-12-09 11:41:39 -0500 (Wed, 09 Dec 2009) | 2 lines Skip new imaplib SSL tests if ssl is not available. ........
Diffstat (limited to 'Lib/imaplib.py')
-rw-r--r--Lib/imaplib.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/imaplib.py b/Lib/imaplib.py
index df35cb1..f803a5c 100644
--- a/Lib/imaplib.py
+++ b/Lib/imaplib.py
@@ -1023,6 +1023,8 @@ class IMAP4:
raise self.abort('socket error: EOF')
# Protocol mandates all lines terminated by CRLF
+ if not line.endswith(b'\r\n'):
+ raise self.abort('socket error: unterminated line')
line = line[:-2]
if __debug__: