mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:11:01 +00:00
inetcomm: Prevent possible dereferences (Coverity).
This commit is contained in:
parent
81a9f4a357
commit
e7f4f3b69c
|
@ -732,7 +732,7 @@ static HRESULT WINAPI SMTPTransport_CommandMAIL(ISMTPTransport2 *iface, LPSTR ps
|
|||
SMTPTransport *This = (SMTPTransport *)iface;
|
||||
const char szCommandFormat[] = "MAIL FROM: <%s>\n";
|
||||
char *szCommand;
|
||||
int len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszEmailFrom);
|
||||
int len;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%s)\n", debugstr_a(pszEmailFrom));
|
||||
|
@ -740,6 +740,7 @@ static HRESULT WINAPI SMTPTransport_CommandMAIL(ISMTPTransport2 *iface, LPSTR ps
|
|||
if (!pszEmailFrom)
|
||||
return E_INVALIDARG;
|
||||
|
||||
len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszEmailFrom);
|
||||
szCommand = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
if (!szCommand)
|
||||
return E_OUTOFMEMORY;
|
||||
|
@ -758,7 +759,7 @@ static HRESULT WINAPI SMTPTransport_CommandRCPT(ISMTPTransport2 *iface, LPSTR ps
|
|||
SMTPTransport *This = (SMTPTransport *)iface;
|
||||
const char szCommandFormat[] = "RCPT TO: <%s>\n";
|
||||
char *szCommand;
|
||||
int len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszEmailTo);
|
||||
int len;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%s)\n", debugstr_a(pszEmailTo));
|
||||
|
@ -766,6 +767,7 @@ static HRESULT WINAPI SMTPTransport_CommandRCPT(ISMTPTransport2 *iface, LPSTR ps
|
|||
if (!pszEmailTo)
|
||||
return E_INVALIDARG;
|
||||
|
||||
len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszEmailTo);
|
||||
szCommand = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
if (!szCommand)
|
||||
return E_OUTOFMEMORY;
|
||||
|
@ -833,7 +835,7 @@ static HRESULT WINAPI SMTPTransport_CommandAUTH(ISMTPTransport2 *iface,
|
|||
SMTPTransport *This = (SMTPTransport *)iface;
|
||||
const char szCommandFormat[] = "AUTH %s\n";
|
||||
char *szCommand;
|
||||
int len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszAuthType);
|
||||
int len;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%s)\n", debugstr_a(pszAuthType));
|
||||
|
@ -841,6 +843,7 @@ static HRESULT WINAPI SMTPTransport_CommandAUTH(ISMTPTransport2 *iface,
|
|||
if (!pszAuthType)
|
||||
return E_INVALIDARG;
|
||||
|
||||
len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszAuthType);
|
||||
szCommand = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
if (!szCommand)
|
||||
return E_OUTOFMEMORY;
|
||||
|
|
Loading…
Reference in a new issue