Bug 1495793 - Fix crash in nsStreamConverter::OnDataAvailable(). r=mkmelin
authorJorg K <jorgk@jorgk.com>
Thu, 04 Oct 2018 17:46:30 +0200
changeset 33299 f0ac78200614874a7157972a822b999a50dd557f
parent 33298 e08d005eaad474e65113799e852723dc440c2282
child 33300 5e8a03122a95a977451fc26cf14ceded41720fbf
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin
bugs1495793
Bug 1495793 - Fix crash in nsStreamConverter::OnDataAvailable(). r=mkmelin
mailnews/mime/src/nsStreamConverter.cpp
--- a/mailnews/mime/src/nsStreamConverter.cpp
+++ b/mailnews/mime/src/nsStreamConverter.cpp
@@ -848,16 +848,18 @@ nsStreamConverter::GetOrigMsgHdr(nsIMsgD
 //
 nsresult
 nsStreamConverter::OnDataAvailable(nsIRequest     *request,
                                    nsISupports    *ctxt,
                                    nsIInputStream *aIStream,
                                    uint64_t       sourceOffset,
                                    uint32_t       aLength)
 {
+  NS_ENSURE_TRUE(aIStream, NS_ERROR_NULL_POINTER);
+
   nsresult        rc=NS_OK;     // should this be an error instead?
   uint32_t        readLen = aLength;
   uint32_t        written;
 
   // If this is the first time through and we are supposed to be
   // outputting the wrapper two pane URL, then do it now.
   if (mWrapperOutput)
   {