kernelbase: Fix an incorrect allocation size.

Variable nt_privs has type TOKEN_PRIVILEGES*, not TOKEN_GROUPS*.

This fixes a crash in the Cyberpunk 2077 launcher.

Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 1ca54db1bf)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Giovanni Mascellani 2021-08-10 16:40:12 +02:00 committed by Michael Stefaniuc
parent f9f4e8f692
commit 8506b2ae18
1 changed files with 1 additions and 1 deletions

View File

@ -667,7 +667,7 @@ BOOL WINAPI CreateRestrictedToken( HANDLE token, DWORD flags,
if (delete_priv_count)
{
if (!(nt_privs = heap_alloc( offsetof( TOKEN_GROUPS, Groups[delete_priv_count] ) ))) goto out;
if (!(nt_privs = heap_alloc( offsetof( TOKEN_PRIVILEGES, Privileges[delete_priv_count] ) ))) goto out;
nt_privs->PrivilegeCount = delete_priv_count;
memcpy( nt_privs->Privileges, delete_privs, delete_priv_count * sizeof(*delete_privs) );
}