diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 21:59:52 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 21:59:52 -0500 |
commit | cea77b76b3fef912bd79e777f97d353aa50474b6 (patch) | |
tree | 5f4792d164e62e4b9a257811dd259cc40c053683 /mailnews/imap/src/nsImapMailFolder.cpp | |
parent | 05667b0d48b50f434ea48a3065adea6c0a88f226 (diff) | |
download | UXP-cea77b76b3fef912bd79e777f97d353aa50474b6.tar UXP-cea77b76b3fef912bd79e777f97d353aa50474b6.tar.gz UXP-cea77b76b3fef912bd79e777f97d353aa50474b6.tar.lz UXP-cea77b76b3fef912bd79e777f97d353aa50474b6.tar.xz UXP-cea77b76b3fef912bd79e777f97d353aa50474b6.zip |
Bug 1333038 - Use 'modern' pointers to fix crash due to nsMsgLineStreamBuffer object being deleted while still in use.
Suspected "use after free" in nsMsgLineStreamBuffer::ReadNextLine() leading to crash since object may be destroyed while still in use on another thread.
Tag #1273
Diffstat (limited to 'mailnews/imap/src/nsImapMailFolder.cpp')
-rw-r--r-- | mailnews/imap/src/nsImapMailFolder.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 4fade9d3f..da1411cd0 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -8379,7 +8379,7 @@ nsImapMailFolder::CopyFileToOfflineStore(nsIFile *srcFile, nsMsgKey msgKey) { // Now, parse the temp file to (optionally) copy to // the offline store for the cur folder. - nsMsgLineStreamBuffer *inputStreamBuffer = + RefPtr<nsMsgLineStreamBuffer> inputStreamBuffer = new nsMsgLineStreamBuffer(FILE_IO_BUFFER_SIZE, true, false); int64_t fileSize; srcFile->GetFileSize(&fileSize); @@ -8443,7 +8443,6 @@ nsImapMailFolder::CopyFileToOfflineStore(nsIFile *srcFile, nsMsgKey msgKey) notifier->NotifyMsgsClassified(messages, false, false); inputStream->Close(); inputStream = nullptr; - delete inputStreamBuffer; } if (offlineStore) offlineStore->Close(); |