]> granicus.if.org Git - python/commitdiff
Avoid crashes with nested multipart/mixed parts.
authorGuido van Rossum <guido@python.org>
Thu, 20 Mar 1997 14:42:17 +0000 (14:42 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 20 Mar 1997 14:42:17 +0000 (14:42 +0000)
Lib/mimify.py

index ce4c4baebf3091ba5201c6ccd35ede2ac4470ac3..15f0981749795cdcdd4ca19b36a42615cf97f577 100755 (executable)
@@ -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)