Skip to content

Commit

Permalink
modernize the test, expand the NEWS entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
gpshead committed Jan 20, 2025
1 parent 284a553 commit d7abc31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_imaplib.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,11 +913,11 @@ def handle(self):
self._send_textline('* OK {%d}' % size)
self._send_textline('IMAP4rev1')

for w in range(15, 64):
size = 1 << w
for exponent in range(15, 64):
size = 1 << exponent
with self.reaped_server(BadHandler) as server:
self.assertRaises(imaplib.IMAP4.abort,
self.imap_class, *server.server_address)
with self.assertRaises(imaplib.IMAP4.abort):
self.imap_class(*server.server_address)

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

0 comments on commit d7abc31

Please sign in to comment.