From 7d2a210b35fbb6d638ca710329ee5792287034ca Mon Sep 17 00:00:00 2001 From: Owen Rudge Date: Fri, 20 Sep 2024 09:49:24 +0100 Subject: [PATCH] ntdll: Set correct MaximumLength when current directory path is longer than MAX_PATH. --- dlls/ntdll/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 720597dcaf9..e0fd75762ec 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -614,7 +614,7 @@ NTSTATUS WINAPI RtlCreateProcessParametersEx( RTL_USER_PROCESS_PARAMETERS **resu curdir = cur_params->CurrentDirectory.DosPath; } else curdir = *CurrentDirectoryName; - curdir.MaximumLength = MAX_PATH * sizeof(WCHAR); + curdir.MaximumLength = max(curdir.Length, MAX_PATH * sizeof(WCHAR)); if (!CommandLine) CommandLine = ImagePathName; if (!Environment && cur_params) Environment = cur_params->Environment;