Bug 612291 - crash [@ nsMsgSaveAsListener::OnDataAvailable(nsIRequest*, nsISupports*, nsIInputStream*, unsigned int, unsigned int)]; r=bienvenu
authortimeless@bemail.org
Fri, 10 Dec 2010 11:35:00 +0000
changeset 6811 e40c2f627634bb577ad8e297f2325cd3e850ba43
parent 6810 66ac1e4701b239b51c2780581bf8a49244eeb36d
child 6812 b515ba820504332e9508e622a6aebba102824860
push idunknown
push userunknown
push dateunknown
reviewersbienvenu
bugs612291
Bug 612291 - crash [@ nsMsgSaveAsListener::OnDataAvailable(nsIRequest*, nsISupports*, nsIInputStream*, unsigned int, unsigned int)]; r=bienvenu
mailnews/base/util/nsMsgMailNewsUrl.cpp
--- a/mailnews/base/util/nsMsgMailNewsUrl.cpp
+++ b/mailnews/base/util/nsMsgMailNewsUrl.cpp
@@ -883,22 +883,23 @@ NS_IMETHODIMP nsMsgSaveAsListener::OnDat
           return NS_ERROR_FAILURE;
 
       // make sure we don't insert another LF, accidentally
       if (lastCharInPrevBuf == '\r' && *start == '\n')
           start++;
 
       while (start && end)
       {
-          if (PL_strncasecmp(start, "X-Mozilla-Status:", 17) &&
+          if (m_outputStream &&
+              PL_strncasecmp(start, "X-Mozilla-Status:", 17) &&
               PL_strncasecmp(start, "X-Mozilla-Status2:", 18) &&
               PL_strncmp(start, "From - ", 7))
           {
               rv = m_outputStream->Write(start, end-start, &writeCount);
-              rv = m_outputStream->Write(lineEnding, lineEndingLength, &writeCount);
+              rv |= m_outputStream->Write(lineEnding, lineEndingLength, &writeCount);
           }
           start = end+linebreak_len;
           if (start >= m_dataBuffer + m_leftOver)
           {
               maxReadCount = SAVE_BUF_SIZE;
               m_leftOver = 0;
               break;
           }