Skip to content

Commit 870c61d

Browse files
committed
Introduce init_process_info helper in proc_open.c
1 parent 79ffaae commit 870c61d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ext/standard/proc_open.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,11 @@ static void init_startup_info(STARTUPINFOW *si, struct php_proc_open_descriptor_
508508
}
509509
}
510510

511+
static void init_process_info(PROCESS_INFORMATION *pi)
512+
{
513+
memset(&pi, 0, sizeof(pi));
514+
}
515+
511516
static int convert_command_to_use_shell(wchar_t **cmdw, size_t cmdw_len)
512517
{
513518
size_t len = sizeof(COMSPEC_NT) + sizeof(" /s /c ") + cmdw_len + 3;
@@ -963,8 +968,7 @@ PHP_FUNCTION(proc_open)
963968
}
964969

965970
init_startup_info(&si, descriptors, ndesc);
966-
967-
memset(&pi, 0, sizeof(pi));
971+
init_process_info(&pi);
968972

969973
if (suppress_errors) {
970974
old_error_mode = SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOGPFAULTERRORBOX);

0 commit comments

Comments
 (0)