From 1d5ec356b3d5ec98177a76eaf2d32e728fd1a742 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 10 Nov 2019 23:38:54 -0500 Subject: Bug 393302 - Correct memory handling in MAPISendMail() and CMapiImp::SendMail() to fix "Send to > Mail Recipient" crash. Tag #1273 --- mailnews/mapi/mapiDll/MapiDll.cpp | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'mailnews/mapi/mapiDll') diff --git a/mailnews/mapi/mapiDll/MapiDll.cpp b/mailnews/mapi/mapiDll/MapiDll.cpp index b6b6ddbf7..ee527df4a 100644 --- a/mailnews/mapi/mapiDll/MapiDll.cpp +++ b/mailnews/mapi/mapiDll/MapiDll.cpp @@ -209,40 +209,7 @@ ULONG FAR PASCAL MAPISendMail (LHANDLE lhSession, ULONG ulUIParam, nsMapiMessage bTempSession = TRUE ; } - // we need to deal with null data passed in by MAPI clients, specially when MAPI_DIALOG is set. - // The MS COM type lib code generated by MIDL for the MS COM interfaces checks for these parameters - // to be non null, although null is a valid value for them here. - nsMapiRecipDesc * lpRecips ; - nsMapiFileDesc * lpFiles ; - - nsMapiMessage Message ; - memset (&Message, 0, sizeof (nsMapiMessage) ) ; - nsMapiRecipDesc Recipient ; - memset (&Recipient, 0, sizeof (nsMapiRecipDesc) ); - nsMapiFileDesc Files ; - memset (&Files, 0, sizeof (nsMapiFileDesc) ) ; - - if(!lpMessage) - { - lpMessage = &Message ; - } - if(!lpMessage->lpRecips) - { - lpRecips = &Recipient ; - } - else - lpRecips = lpMessage->lpRecips ; - if(!lpMessage->lpFiles) - { - lpFiles = &Files ; - } - else - lpFiles = lpMessage->lpFiles ; - - hr = pNsMapi->SendMail (lhSession, lpMessage, - (short) lpMessage->nRecipCount, lpRecips, - (short) lpMessage->nFileCount, lpFiles, - flFlags, ulReserved); + hr = pNsMapi->SendMail(lhSession, lpMessage, flFlags, ulReserved); // we are seeing a problem when using Word, although we return success from the MAPI support // MS COM interface in mozilla, we are getting this error here. This is a temporary hack !! -- cgit v1.2.3