Skip to content

Commit d7abc31

Browse files
committed
modernize the test, expand the NEWS entry.
1 parent 284a553 commit d7abc31

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Lib/test/test_imaplib.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -913,11 +913,11 @@ def handle(self):
913913
self._send_textline('* OK {%d}' % size)
914914
self._send_textline('IMAP4rev1')
915915

916-
for w in range(15, 64):
917-
size = 1 << w
916+
for exponent in range(15, 64):
917+
size = 1 << exponent
918918
with self.reaped_server(BadHandler) as server:
919-
self.assertRaises(imaplib.IMAP4.abort,
920-
self.imap_class, *server.server_address)
919+
with self.assertRaises(imaplib.IMAP4.abort):
920+
self.imap_class(*server.server_address)
921921

922922
@threading_helper.reap_threads
923923
def test_simple_with_statement(self):
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
1-
Fix a vulnerability in the :mod:`imaplib` module, when connecting to a
2-
malicious server could cause an arbitrary amount of memory to be consumed.
1+
Fix a potential denial of service vulnerability in the :mod:`imaplib` module.
2+
When connecting to a malicious server, it could cause an arbitrary amount of
3+
memory to be allocated. On many systems this is harmless as unused virtual
4+
memory is only a mapping, but if this hit a virtual address size limit it could
5+
lead to a :exc:`MemoryError` or other process crash. On unusual systems or
6+
builds where all allocated memory is touched and backed by actual ram or
7+
storage it could've consumed resources doing so until similarly crashing.

0 commit comments

Comments
 (0)