Bug 594239 - Follow-up: Don't pass null to nsDependentCString. r=me a=IanN DONTBUILD SEAMONKEY_2_49_ESR_RELBRANCH
authorJorg K <jorgk@jorgk.com>
Mon, 21 Jan 2019 00:32:16 +0100
branchSEAMONKEY_2_49_ESR_RELBRANCH
changeset 28331 d5fd2f836c7b2b51c5edabce77c14e6775c094f0
parent 28330 a56d8703036ee1524567c7ae2b4815dce76034c9
child 28332 f36daf7e1905a52393c528eec9527a624fa3663d
push id2136
push userfrgrahl@gmx.net
push dateMon, 15 Jul 2019 16:13:42 +0000
treeherdercomm-esr52@6b30146aa411 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, IanN
bugs594239
Bug 594239 - Follow-up: Don't pass null to nsDependentCString. r=me a=IanN DONTBUILD SeaMonkey ESR52 release branch only.
mailnews/mapi/mapihook/src/msgMapiImp.cpp
--- a/mailnews/mapi/mapihook/src/msgMapiImp.cpp
+++ b/mailnews/mapi/mapihook/src/msgMapiImp.cpp
@@ -164,20 +164,21 @@ STDMETHODIMP CMapiImp::Login(unsigned lo
     }
 
     // finally register(create) the session.
     uint32_t nSession_Id;
     int16_t nResult = 0;
 
     nsMAPIConfiguration *pConfig = nsMAPIConfiguration::GetMAPIConfiguration();
     if (pConfig != nullptr)
-        nResult = pConfig->RegisterSession(aUIArg, nsDependentCString(aLogin),
-                                           nsDependentCString(aPassWord),
-                                           (aFlags & MAPI_FORCE_DOWNLOAD), bNewSession,
-                                           &nSession_Id, id_key.get());
+        nResult = pConfig->RegisterSession(aUIArg,
+            aLogin ? nsDependentCString(aLogin) : EmptyCString(),
+            aPassWord ? nsDependentCString(aPassWord) : EmptyCString(),
+            (aFlags & MAPI_FORCE_DOWNLOAD), bNewSession, 
+            &nSession_Id, id_key.get());
     switch (nResult)
     {
         case -1 :
         {
             *aSessionId = MAPI_E_TOO_MANY_SESSIONS;
             return hr;
         }
         case 0 :