[ADVAPI32] Add parameter checks to LogonUserExW and initialize the token handle.

This commit is contained in:
Eric Kohl 2018-08-05 16:16:53 +02:00
parent b4040ea740
commit 5ebcc6cdc1

View file

@ -469,7 +469,21 @@ LogonUserExW(
NTSTATUS SubStatus = STATUS_SUCCESS; NTSTATUS SubStatus = STATUS_SUCCESS;
NTSTATUS Status; NTSTATUS Status;
*phToken = NULL; if ((ppProfileBuffer != NULL && pdwProfileLength == NULL) ||
(ppProfileBuffer == NULL && pdwProfileLength != NULL))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (ppProfileBuffer != NULL && pdwProfileLength != NULL)
{
*ppProfileBuffer = NULL;
*pdwProfileLength = 0;
}
if (phToken != NULL)
*phToken = NULL;
switch (dwLogonType) switch (dwLogonType)
{ {
@ -654,9 +668,10 @@ LogonUserExW(
TRACE("TokenHandle: %p\n", TokenHandle); TRACE("TokenHandle: %p\n", TokenHandle);
} }
*phToken = TokenHandle; if (phToken != NULL)
*phToken = TokenHandle;
/* FIXME: return ppLogonSid, ppProfileBuffer, pdwProfileLength and pQuotaLimits */ /* FIXME: return ppLogonSid and pQuotaLimits */
done: done:
if (ProfileBuffer != NULL) if (ProfileBuffer != NULL)