Piotr Caban : ntdll: Don't overwrite last byte of RuntimeInfo if odd number of bytes is used.
Module: wine Branch: master Commit: c73bea16eb510c5806c9477eeacc63a6d5092f17 URL: https://gitlab.winehq.org/wine/wine/-/commit/c73bea16eb510c5806c9477eeacc63a... Author: Piotr Caban <piotr(a)codeweavers.com> Date: Thu Aug 24 14:39:36 2023 +0200 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 --- 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,
participants (1)
-
Alexandre Julliard