Bug 837552, crash in nsMsgDatabase::CopyHdrFromExistingHdr with filters, r=neil, a=rkent
authorR Kent James <rkent@caspia.com>
Wed, 01 Jul 2015 13:19:21 -0700
changeset 26179 716e805c17d378417043b2a5701e3ad145654b9f
parent 26178 253dda85473472501e080aaa5813aef5d9385800
child 26180 c394981a2bfa63f78095369f14210d582ba8bbee
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, rkent
bugs837552
Bug 837552, crash in nsMsgDatabase::CopyHdrFromExistingHdr with filters, r=neil, a=rkent
mailnews/db/msgdb/src/nsMsgDatabase.cpp
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -3542,16 +3542,19 @@ NS_IMETHODIMP nsMsgDatabase::CopyHdrFrom
     nsMsgHdr* sourceMsgHdr = static_cast<nsMsgHdr*>(existingHdr);      // closed system, cast ok
     nsMsgHdr *destMsgHdr = nullptr;
     CreateNewHdr(key, (nsIMsgDBHdr **) &destMsgHdr);
     nsIMdbRow  *sourceRow = sourceMsgHdr->GetMDBRow();
     if (!destMsgHdr || !sourceRow)
       return NS_MSG_MESSAGE_NOT_FOUND;
 
     nsIMdbRow  *destRow = destMsgHdr->GetMDBRow();
+    if (!destRow)
+      return NS_ERROR_UNEXPECTED;
+
     err = destRow->SetRow(GetEnv(), sourceRow);
     if (NS_SUCCEEDED(err))
     {
       // we may have gotten the header from a cache - calling SetRow
       // basically invalidates any cached values, so invalidate them.
       destMsgHdr->m_initedValues = 0;
       if(addHdrToDB)
         err = AddNewHdrToDB(destMsgHdr, true);