winemapi: Ensure address is valid before checking for 'smtp:'.

This commit is contained in:
Owen Rudge 2011-06-09 16:27:43 +01:00 committed by Alexandre Julliard
parent f1be598efa
commit 7cd20a413e
1 changed files with 6 additions and 4 deletions
dlls/winemapi

View File

@ -87,11 +87,12 @@ ULONG WINAPI MAPISendMail(LHANDLE session, ULONG_PTR uiparam,
}
address = message->lpRecips[i].lpszAddress;
if (!strncasecmp(address, smtp, sizeof(smtp) - 1))
address += sizeof(smtp) - 1;
if (address)
{
if (!strncasecmp(address, smtp, sizeof(smtp) - 1))
address += sizeof(smtp) - 1;
switch (message->lpRecips[i].ulRecipClass)
{
case MAPI_ORIG:
@ -172,11 +173,12 @@ ULONG WINAPI MAPISendMail(LHANDLE session, ULONG_PTR uiparam,
for (i = 0; i < message->nRecipCount; i++)
{
address = message->lpRecips[i].lpszAddress;
if (!strncasecmp(address, smtp, sizeof(smtp) - 1))
address += sizeof(smtp) - 1;
if (address)
{
if (!strncasecmp(address, smtp, sizeof(smtp) - 1))
address += sizeof(smtp) - 1;
switch (message->lpRecips[i].ulRecipClass)
{
case MAPI_TO: