https://bugs.winehq.org/show_bug.cgi?id=49118
Bug ID: 49118 Summary: env.c:get_image_path() de-reference null pointer Product: Wine Version: 5.7 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: rich.coe2@gmail.com Distribution: ---
In the method dlls/ntdll/env.c:get_image_path() the call to RtlGetFullPathName_U() will set file_part pointer to null if it fails or full_name is a directory.
I found this when the path to the executable passed to wine was not parsing the spaces correctly.
diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 71ae48681d..a89a62b893 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -707,6 +707,7 @@ static void get_image_path( const char *argv0, UNICODE_STRING *path ) { len = RtlGetFullPathName_U( name, sizeof(full_name), full_name, &file_part ); if (!len || len > sizeof(full_name)) goto failed; + if (NULL == file_part) goto failed; /* try first without extension */ if (RtlDoesFileExists_U( full_name )) goto done; if (len < (MAX_PATH - 4) * sizeof(WCHAR) && !wcschr( file_part, '.' ))
https://bugs.winehq.org/show_bug.cgi?id=49118
--- Comment #1 from Gijs Vermeulen gijsvrm@gmail.com --- This code was changed heavily in recent version, in particular https://source.winehq.org/git/wine.git/commit/28fe84da45bea7de56539b50eac8ebcec54342de removes get_image_path().
Can you still reproduce this with wine-6.6?