Bug 770022 - Provide fallback when UnEscapeNonAsciiURI() fails in nsMIMEInfoWin::LoadUriInternal(). r=bz, a=lizzard
authorJorg K <jorgk@jorgk.com>
Wed, 08 Feb 2017 14:37:00 +0800
changeset 376100 afe4b9f1e68fca6bccec544b4ada54b6d75c9114
parent 376099 5c0b8a190eb779b48be00454f00310aac1fe4875
child 376101 0e65e784125aae1836f4657e490d91654ccf1eae
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, lizzard
bugs770022
milestone53.0a2
Bug 770022 - Provide fallback when UnEscapeNonAsciiURI() fails in nsMIMEInfoWin::LoadUriInternal(). r=bz, a=lizzard
uriloader/exthandler/win/nsMIMEInfoWin.cpp
--- a/uriloader/exthandler/win/nsMIMEInfoWin.cpp
+++ b/uriloader/exthandler/win/nsMIMEInfoWin.cpp
@@ -230,18 +230,19 @@ nsMIMEInfoWin::LoadUriInternal(nsIURI * 
     nsAutoCString urlCharset;
     nsAutoString utf16Spec;
     rv = aURL->GetOriginCharset(urlCharset);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsITextToSubURI> textToSubURI = do_GetService(NS_ITEXTTOSUBURI_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = textToSubURI->UnEscapeNonAsciiURI(urlCharset, urlSpec, utf16Spec);
-    NS_ENSURE_SUCCESS(rv, rv);
+    if (NS_FAILED(textToSubURI->UnEscapeNonAsciiURI(urlCharset, urlSpec, utf16Spec))) {
+      CopyASCIItoUTF16(urlSpec, utf16Spec);
+    }
 
     static const wchar_t cmdVerb[] = L"open";
     SHELLEXECUTEINFOW sinfo;
     memset(&sinfo, 0, sizeof(sinfo));
     sinfo.cbSize   = sizeof(sinfo);
     sinfo.fMask    = SEE_MASK_FLAG_DDEWAIT |
       SEE_MASK_FLAG_NO_UI;
     sinfo.hwnd     = nullptr;