Bug 1401026 - Follow-up: Fix unsafe use of NS_ConvertUTF8toUTF16(). r+a=me DONTBUILD
authorJorg K <jorgk@jorgk.com>
Tue, 21 Nov 2017 22:23:01 +0100
changeset 29388 8a0947246021f21690004c214b344cd7891b23de
parent 29387 c1f5d46aa9613ef790fa73dbfdea95fd0f9a7536
child 29389 2c6dca90d20f2006220700947f023897ee9193a9
push id2074
push usermozilla@jorgk.com
push dateTue, 21 Nov 2017 21:25:28 +0000
treeherdercomm-beta@8a0947246021 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1401026
Bug 1401026 - Follow-up: Fix unsafe use of NS_ConvertUTF8toUTF16(). r+a=me DONTBUILD
mailnews/imap/src/nsImapIncomingServer.cpp
--- a/mailnews/imap/src/nsImapIncomingServer.cpp
+++ b/mailnews/imap/src/nsImapIncomingServer.cpp
@@ -1892,17 +1892,18 @@ nsImapIncomingServer::FEAlertWithName(co
   nsString message;
 
   if (m_stringBundle)
   {
     nsAutoCString hostName;
     nsresult rv = GetHostName(hostName);
     if (NS_SUCCEEDED(rv))
     {
-      const char16_t *params[] = { NS_ConvertUTF8toUTF16(hostName).get() };
+      const NS_ConvertUTF8toUTF16 hostName16(hostName);
+      const char16_t *params[] = { hostName16.get() };
       rv = m_stringBundle->FormatStringFromName(
         aMsgName,
         params, 1,message);
       if (NS_SUCCEEDED(rv))
         return AlertUser(message, aUrl);
     }
   }