Bug 1310453 - Check whether aUri isn't created. r=jimm, a=ritu
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 17 Oct 2016 12:17:42 +0900
changeset 350741 f6ee39199d93be1dd8fc4083d499d5046fcc9b4c
parent 350740 c5487cf50dbc2052912a75ffc33c5b44d36ed6df
child 350742 444760be4952778128a25c687403c2c1c5579746
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, ritu
bugs1310453
milestone50.0
Bug 1310453 - Check whether aUri isn't created. r=jimm, a=ritu Since aUri is nullptr, Firefox will crash on shutdown. MozReview-Commit-ID: E5ENWsjK7Px
widget/windows/nsDataObj.cpp
--- a/widget/windows/nsDataObj.cpp
+++ b/widget/windows/nsDataObj.cpp
@@ -1128,19 +1128,21 @@ HRESULT
 nsDataObj :: GetFileContentsInternetShortcut ( FORMATETC& aFE, STGMEDIUM& aSTG )
 {
   static const char * kShellIconPref = "browser.shell.shortcutFavicons";
   nsAutoString url;
   if ( NS_FAILED(ExtractShortcutURL(url)) )
     return E_OUTOFMEMORY;
 
   nsCOMPtr<nsIURI> aUri;
-  NS_NewURI(getter_AddRefs(aUri), url);
+  nsresult rv = NS_NewURI(getter_AddRefs(aUri), url);
+  if (NS_FAILED(rv)) {
+    return E_FAIL;
+  }
 
-  nsresult rv;
   nsAutoCString asciiUrl;
   rv = aUri->GetAsciiSpec(asciiUrl);
   if (NS_FAILED(rv)) {
     return E_FAIL;
   }
 
   const char *shortcutFormatStr;
   int totalLen;