Alexandre Julliard : ntdll: Adjust environment size for dynamic strings.

Alexandre Julliard julliard at winehq.org
Mon Mar 1 15:54:03 CST 2021


Module: wine
Branch: master
Commit: 5828d7c136cf4c22e1f999929f9e97c91c555123
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=5828d7c136cf4c22e1f999929f9e97c91c555123

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Feb 27 17:42:26 2021 +0100

ntdll: Adjust environment size for dynamic strings.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50732
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/env.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index f5979a980ea..845abd69a79 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -1591,7 +1591,6 @@ void init_startup_info(void)
     params->AllocationSize  = size;
     params->Size            = size;
     params->Flags           = PROCESS_PARAMS_FLAG_NORMALIZED;
-    params->EnvironmentSize = env_size;
     params->DebugFlags      = info->debug_flags;
     params->ConsoleHandle   = wine_server_ptr_handle( info->console );
     params->ConsoleFlags    = info->console_flags;
@@ -1637,7 +1636,8 @@ void init_startup_info(void)
     dst += copy_environment( dst, src );
     memcpy( dst, dyn_env, dyn_size );
     dst += dyn_size / sizeof(WCHAR);
-    *dst = 0;
+    *dst++ = 0;
+    params->EnvironmentSize = (dst - params->Environment) * sizeof(WCHAR);
     free( dyn_env );
     free( info );
     NtCurrentTeb()->Peb->ProcessParameters = params;




More information about the wine-cvs mailing list