Alexandre Julliard : ntdll: Fix rounding the length of the runtime info parameter.
Alexandre Julliard
julliard at winehq.org
Thu Feb 25 16:45:37 CST 2021
Module: wine
Branch: master
Commit: 4dad4315d52d6125991bdd14d0a6c0ad71e7c24d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4dad4315d52d6125991bdd14d0a6c0ad71e7c24d
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Feb 25 22:38:44 2021 +0100
ntdll: Fix rounding the length of the runtime info parameter.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50723
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/unix/env.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index c7870c6bb4e..c6037afafbc 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -1622,8 +1622,14 @@ void init_startup_info(void)
copy_unicode_string( &src, &dst, ¶ms->WindowTitle, info->title_len );
copy_unicode_string( &src, &dst, ¶ms->Desktop, info->desktop_len );
copy_unicode_string( &src, &dst, ¶ms->ShellInfo, info->shellinfo_len );
- copy_unicode_string( &src, &dst, ¶ms->RuntimeInfo, info->runtime_len );
- params->RuntimeInfo.MaximumLength = params->RuntimeInfo.Length; /* runtime info isn't a real string */
+ /* runtime info isn't a real string */
+ params->RuntimeInfo.MaximumLength = params->RuntimeInfo.Length = info->runtime_len;
+ params->RuntimeInfo.Buffer = dst;
+ memcpy( dst, src, info->runtime_len );
+ src += (info->runtime_len + 1) / sizeof(WCHAR);
+ dst += (info->runtime_len + 1) / sizeof(WCHAR);
+ assert( (char *)src == (char *)info + info_size );
+
params->Environment = dst;
dst += copy_environment( dst, src );
memcpy( dst, dyn_env, dyn_size );
More information about the wine-cvs
mailing list