mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Avoid crashes with nested multipart/mixed parts.
This commit is contained in:
parent
14d1c721d5
commit
f789ee4a86
1 changed files with 8 additions and 1 deletions
|
@ -367,7 +367,14 @@ def mimify_part(ifile, ofile, is_mime):
|
|||
line = message_end
|
||||
while multipart:
|
||||
if line == multipart + '--\n':
|
||||
return
|
||||
# read bit after the end of the last part
|
||||
while 1:
|
||||
line = ifile.readline()
|
||||
if not line:
|
||||
return
|
||||
if must_quote_body:
|
||||
line = mime_encode(line, 0)
|
||||
ofile.write(line)
|
||||
if line == multipart + '\n':
|
||||
nifile = File(ifile, multipart)
|
||||
mimify_part(nifile, ofile, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue