Bug 1175348 - oauth related crash in nsMsgAsyncWriteProtocol::SendData(char const*, bool). r=rkent, a=rkent SEAMONKEY_2_35_RELEASE_BRANCH
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Wed, 17 Jun 2015 23:18:20 +0300
branchSEAMONKEY_2_35_RELEASE_BRANCH
changeset 31184 0b3c0bc49ac94a6b55f7e760dd6f8711e6d1124a
parent 31183 c8490761484d7ccf9c0aa86d2f1daa555be6b3b4
child 31185 fd8425db2bfe02489a306d876411a11f99aa1a3e
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)
reviewersrkent, rkent
bugs1175348
Bug 1175348 - oauth related crash in nsMsgAsyncWriteProtocol::SendData(char const*, bool). r=rkent, a=rkent a=IanN for uplift to comm-release+SEAMONKEY_2_35_RELEASE_BRANCH CLOSED TREE
mailnews/base/util/nsMsgProtocol.cpp
--- a/mailnews/base/util/nsMsgProtocol.cpp
+++ b/mailnews/base/util/nsMsgProtocol.cpp
@@ -1441,19 +1441,19 @@ nsresult nsMsgAsyncWriteProtocol::CloseS
   nsMsgProtocol::CloseSocket();
 
   if (mFilePostHelper)
   {
     mFilePostHelper->CloseSocket();
     mFilePostHelper = nullptr;
   }
 
-  mAsyncOutStream = 0;
-  mProvider = 0;
-  mProviderThread = 0;
+  mAsyncOutStream = nullptr;
+  mProvider = nullptr;
+  mProviderThread = nullptr;
   mAsyncBuffer.Truncate();
   return rv;
 }
 
 void nsMsgAsyncWriteProtocol::UpdateProgress(uint32_t aNewBytes)
 {
   if (!mGenerateProgressNotifications) return;
 
@@ -1475,16 +1475,18 @@ void nsMsgAsyncWriteProtocol::UpdateProg
   }
 
   return;
 }
 
 nsresult nsMsgAsyncWriteProtocol::SendData(const char * dataBuffer, bool aSuppressLogging)
 {
   this->mAsyncBuffer.Append(dataBuffer);
+  if (!mAsyncOutStream)
+    return NS_ERROR_FAILURE;
   return mAsyncOutStream->AsyncWait(mProvider, 0, 0, mProviderThread);
 }
 
 char16_t *FormatStringWithHostNameByID(int32_t stringID, nsIMsgMailNewsUrl *msgUri)
 {
   if (!msgUri)
     return nullptr;