Bug 1513826 - Don't crash in nsImapService::FetchMimePart() if URL passed in can't be QI'ed. r=mkmelin a=jorgk
authorJorg K <jorgk@jorgk.com>
Mon, 12 Aug 2019 09:56:22 +0200
changeset 35291 4081e478928cf08b3eecda59423387a6eefd86eb
parent 35290 a221fedbe06298daff382f00ab1e5890c3f6b1b3
child 35292 c850972a72351538ece8d91ed11c2f810769df3f
push id2477
push usermozilla@jorgk.com
push dateTue, 13 Aug 2019 21:14:23 +0000
treeherdercomm-beta@436d8b620b6a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, jorgk
bugs1513826
Bug 1513826 - Don't crash in nsImapService::FetchMimePart() if URL passed in can't be QI'ed. r=mkmelin a=jorgk
mailnews/imap/src/nsImapService.cpp
--- a/mailnews/imap/src/nsImapService.cpp
+++ b/mailnews/imap/src/nsImapService.cpp
@@ -358,17 +358,18 @@ NS_IMETHODIMP nsImapService::FetchMimePa
   NS_ENSURE_SUCCESS(rv, rv);
   rv = nsParseImapMessageURI(aMessageURI, folderURI, &key,
                              getter_Copies(mimePart));
   if (NS_SUCCEEDED(rv)) {
     nsCOMPtr<nsIImapMessageSink> imapMessageSink(
         do_QueryInterface(folder, &rv));
     if (NS_SUCCEEDED(rv)) {
       nsCOMPtr<nsIImapUrl> imapUrl = do_QueryInterface(aURI);
-      nsCOMPtr<nsIMsgMailNewsUrl> msgurl(do_QueryInterface(aURI));
+      nsCOMPtr<nsIMsgMailNewsUrl> msgurl(do_QueryInterface(aURI, &rv));
+      NS_ENSURE_SUCCESS(rv, rv);
 
       msgurl->SetMsgWindow(aMsgWindow);
       msgurl->RegisterListener(aUrlListener);
 
       if (!mimePart.IsEmpty()) {
         return FetchMimePart(imapUrl, nsIImapUrl::nsImapMsgFetch, folder,
                              imapMessageSink, aURL, aDisplayConsumer, msgKey,
                              mimePart);