Bug 1497513 - fix incorrect use of nsDependentCString. r=me
authorJorg K <jorgk@jorgk.com>
Wed, 17 Oct 2018 10:17:21 +0200
changeset 33384 6dda9a7770fc8002defb8324162fcbe3c5420c7f
parent 33383 8aebb2ed9307360384bb2cc5c35bde65e7535ac7
child 33385 436e28c477f716f6f30716f16aee3f67584e6b88
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersme
bugs1497513
Bug 1497513 - fix incorrect use of nsDependentCString. r=me
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/local/src/nsParseMailbox.cpp
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -3102,17 +3102,17 @@ nsresult nsImapMailFolder::NormalEndHead
 
       if (NS_SUCCEEDED(rv) && headers && !m_msgMovedByFilter &&
           !m_filterListRequiresBody)
       {
         if (m_filterList)
         {
           GetMoveCoalescer();  // not sure why we're doing this here.
           m_filterList->ApplyFiltersToHdr(nsMsgFilterType::InboxRule, newMsgHdr,
-                                          this, mDatabase, nsDependentCString(headers, headersSize),
+                                          this, mDatabase, nsDependentCSubstring(headers, headersSize),
                                           this, msgWindow);
           NotifyFolderEvent(kFiltersApplied);
         }
       }
     }
   }
   // here we need to tweak flags from uid state..
   if (mDatabase && (!m_msgMovedByFilter || ShowDeletedMessages()))
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -1923,22 +1923,22 @@ void nsParseNewMailState::ApplyFilters(b
                                           getter_AddRefs(downloadFolder));
       if (downloadFolder)
         downloadFolder->GetURI(m_inboxUri);
       char * headers = m_headers.GetBuffer();
       uint32_t headersSize = m_headers.GetBufferPos();
       if (m_filterList)
         (void) m_filterList->
           ApplyFiltersToHdr(nsMsgFilterType::InboxRule, msgHdr, downloadFolder,
-                            m_mailDB, nsDependentCString(headers, headersSize), this, msgWindow);
+                            m_mailDB, nsDependentCSubstring(headers, headersSize), this, msgWindow);
       if (!m_msgMovedByFilter && m_deferredToServerFilterList)
       {
         (void) m_deferredToServerFilterList->
           ApplyFiltersToHdr(nsMsgFilterType::InboxRule, msgHdr, downloadFolder,
-                            m_mailDB, nsDependentCString(headers, headersSize), this, msgWindow);
+                            m_mailDB, nsDependentCSubstring(headers, headersSize), this, msgWindow);
       }
     }
   }
   if (pMoved)
     *pMoved = m_msgMovedByFilter;
 }
 
 NS_IMETHODIMP nsParseNewMailState::ApplyFilterHit(nsIMsgFilter *filter, nsIMsgWindow *msgWindow, bool *applyMore)