Bug 1400432 - Fix crash in nsImapCancelProxy::Run(). r=mkmelin
authorJorg K <jorgk@jorgk.com>
Wed, 03 Oct 2018 11:02:00 +0200
changeset 33297 37c79adc0b983e12a3bec6f6832607372e1f3ca7
parent 33296 c2608a685d0082508f8a32c8f3c4f14737285214
child 33298 e08d005eaad474e65113799e852723dc440c2282
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin
bugs1400432
Bug 1400432 - Fix crash in nsImapCancelProxy::Run(). r=mkmelin
mailnews/imap/src/nsImapProtocol.cpp
--- a/mailnews/imap/src/nsImapProtocol.cpp
+++ b/mailnews/imap/src/nsImapProtocol.cpp
@@ -1027,24 +1027,25 @@ public:
   }
 private:
   nsCOMPtr<nsIThread> mThread;
 };
 
 class nsImapCancelProxy : public mozilla::Runnable {
 public:
   explicit nsImapCancelProxy(nsICancelable *aProxyRequest)
-    : mozilla::Runnable("nsImapCancelProxy"), m_proxyRequest(aProxyRequest) {
+    : mozilla::Runnable("nsImapCancelProxy"), mRequest(aProxyRequest) {
   }
   NS_IMETHOD Run() {
-    m_proxyRequest->Cancel(NS_BINDING_ABORTED);
+    if (mRequest)
+      mRequest->Cancel(NS_BINDING_ABORTED);
     return NS_OK;
   }
 private:
-  nsCOMPtr<nsICancelable> m_proxyRequest;
+  nsCOMPtr<nsICancelable> mRequest;
 };
 
 NS_IMETHODIMP nsImapProtocol::Run()
 {
   PR_CEnterMonitor(this);
   NS_ASSERTION(!m_imapThreadIsRunning,
                  "Oh. oh. thread is already running. What's wrong here?");
     if (m_imapThreadIsRunning)