[PATCH v2 0/1] MR3652: ntdll: Don't overwrite last byte of RuntimeInfo if odd number of bytes is used.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55287 -- v2: ntdll: Don't overwrite last byte of RuntimeInfo if odd number of bytes is used. https://gitlab.winehq.org/wine/wine/-/merge_requests/3652
From: Piotr Caban <piotr(a)codeweavers.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55287 --- 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 3f00f6f68de..f42c6a8f59f 100644 --- a/dlls/ntdll/unix/env.c +++ b/dlls/ntdll/unix/env.c @@ -1702,7 +1702,7 @@ static inline void dup_unicode_string( const UNICODE_STRING *src, WCHAR **dst, U str->Length = src->Length; str->MaximumLength = src->MaximumLength; memcpy( *dst, src->Buffer, src->MaximumLength ); - *dst += src->MaximumLength / sizeof(WCHAR); + *dst += (src->MaximumLength + 1) / sizeof(WCHAR); } @@ -1798,7 +1798,7 @@ static void *build_wow64_parameters( const RTL_USER_PROCESS_PARAMETERS *params ) + params->WindowTitle.MaximumLength + params->Desktop.MaximumLength + params->ShellInfo.MaximumLength - + params->RuntimeInfo.MaximumLength + + ((params->RuntimeInfo.MaximumLength + 1) & ~1) + params->EnvironmentSize); status = NtAllocateVirtualMemory( NtCurrentProcess(), (void **)&wow64_params, 0, &size, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/3652
On Thu Aug 24 16:25:38 2023 +0000, Alexandre Julliard wrote:
This would mis-align the environment strings. I've pushed another version that adds padding after RuntimeInfo. Thanks.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3652#note_43296
participants (2)
-
Piotr Caban -
Piotr Caban (@piotr)