Alexandre Julliard : ntdll: Don't set runtime info at all if it's empty.

Alexandre Julliard julliard at winehq.org
Fri Feb 26 14:39:28 CST 2021


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Feb 26 13:34:19 2021 +0100

ntdll: Don't set runtime info at all if it's empty.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/unix/env.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/dlls/ntdll/unix/env.c b/dlls/ntdll/unix/env.c
index c6037afafbc..f5979a980ea 100644
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -1622,12 +1622,15 @@ void init_startup_info(void)
     copy_unicode_string( &src, &dst, &params->WindowTitle, info->title_len );
     copy_unicode_string( &src, &dst, &params->Desktop, info->desktop_len );
     copy_unicode_string( &src, &dst, &params->ShellInfo, info->shellinfo_len );
-    /* 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);
+    if (info->runtime_len)
+    {
+        /* 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;




More information about the wine-cvs mailing list