From: Guido van Rossum Date: Thu, 20 Mar 1997 14:42:17 +0000 (+0000) Subject: Avoid crashes with nested multipart/mixed parts. X-Git-Tag: v1.5a1~274 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f789ee4a8606ef1c34f2f18389b46c9b54ee04ae;p=thirdparty%2FPython%2Fcpython.git Avoid crashes with nested multipart/mixed parts. --- diff --git a/Lib/mimify.py b/Lib/mimify.py index ce4c4baebf30..15f098174979 100755 --- a/Lib/mimify.py +++ b/Lib/mimify.py @@ -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)