Bug 1411737 - Fix crash when forwarding message with non-existent file in X-Mozilla-Cloud-Part header. r=jorgk CLOSED TREE
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Sat, 28 Oct 2017 14:29:34 +0300
changeset 29283 c28b7379ca06000b0648ffc615d3344ff4dbabce
parent 29282 36ad3fb2f6cb8ea8ea6275aef6440c96f3fc2ffa
child 29284 1130d5a2c7009582877d46cb3f19e5cb1ed6e3ca
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1411737
Bug 1411737 - Fix crash when forwarding message with non-existent file in X-Mozilla-Cloud-Part header. r=jorgk CLOSED TREE
mailnews/mime/src/mimedrft.cpp
--- a/mailnews/mime/src/mimedrft.cpp
+++ b/mailnews/mime/src/mimedrft.cpp
@@ -1479,17 +1479,17 @@ mime_parse_stream_complete(nsMIMESession
           //We cannot use this kind of data for the message body! Therefore, move it as attachment
           bodyAsAttachment = true;
       }
       else
         composeFormat = nsIMsgCompFormat::PlainText;
 
       char *body = nullptr;
 
-      if (!bodyAsAttachment)
+      if (!bodyAsAttachment && mdd->messageBody->m_tmpFile)
       {
         int64_t fileSize;
         nsCOMPtr<nsIFile> tempFileCopy;
         mdd->messageBody->m_tmpFile->Clone(getter_AddRefs(tempFileCopy));
         mdd->messageBody->m_tmpFile = do_QueryInterface(tempFileCopy);
         tempFileCopy = nullptr;
         mdd->messageBody->m_tmpFile->GetFileSize(&fileSize);
         uint32_t bodyLen = 0;