ntdll: Make sure we send valid object attributes in NtCreateUserProcess().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-03-04 13:04:42 +01:00
parent 9443a7397d
commit d0a1bddea0
1 changed files with 2 additions and 0 deletions

View File

@ -861,6 +861,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_
CLIENT_ID id; CLIENT_ID id;
HANDLE parent = 0, debug = 0, token = 0; HANDLE parent = 0, debug = 0, token = 0;
UNICODE_STRING path = {0}; UNICODE_STRING path = {0};
OBJECT_ATTRIBUTES empty_attr = { sizeof(empty_attr) };
SIZE_T i, attr_count = (attr->TotalLength - sizeof(attr->TotalLength)) / sizeof(PS_ATTRIBUTE); SIZE_T i, attr_count = (attr->TotalLength - sizeof(attr->TotalLength)) / sizeof(PS_ATTRIBUTE);
const PS_ATTRIBUTE *handles_attr = NULL; const PS_ATTRIBUTE *handles_attr = NULL;
data_size_t handles_size; data_size_t handles_size;
@ -893,6 +894,7 @@ NTSTATUS WINAPI NtCreateUserProcess( HANDLE *process_handle_ptr, HANDLE *thread_
break; break;
} }
} }
if (!process_attr) process_attr = &empty_attr;
TRACE( "%s image %s cmdline %s parent %p\n", debugstr_us( &path ), TRACE( "%s image %s cmdline %s parent %p\n", debugstr_us( &path ),
debugstr_us( &params->ImagePathName ), debugstr_us( &params->CommandLine ), parent ); debugstr_us( &params->ImagePathName ), debugstr_us( &params->CommandLine ), parent );