Bug 837552, crash in nsMsgDatabase::CopyHdrFromExistingHdr with filters, r=neil, a=rkent a=IanN for comm-release SeaMonkey 2.35 release CLOSED TREE SEAMONKEY_2_35_RELEASE_BRANCH
authorR Kent James <rkent@caspia.com>
Wed, 01 Jul 2015 13:19:21 -0700
branchSEAMONKEY_2_35_RELEASE_BRANCH
changeset 31173 04286406c5bf41860d54e53aeb2e4bcb9939fcbd
parent 31171 9fc1b27a10a2d1d64e94ef4bd1e08bbc774e0a6b
child 31174 e70cf3ae7723ba1cfaa7a0f4d0404e5337b1195a
push id1
push userclokep@gmail.com
push dateMon, 07 May 2018 22:45:56 +0000
treeherdercomm-esr60@57eacde5ef40 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, rkent, IanN
bugs837552
Bug 837552, crash in nsMsgDatabase::CopyHdrFromExistingHdr with filters, r=neil, a=rkent a=IanN for comm-release SeaMonkey 2.35 release CLOSED TREE
mailnews/db/msgdb/src/nsMsgDatabase.cpp
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -3537,16 +3537,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);