[Bug 49118] New: env.c:get_image_path() de-reference null pointer

WineHQ Bugzilla wine-bugs at winehq.org
Fri May 8 10:09:10 CDT 2020


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 at winehq.org
          Reporter: rich.coe2 at 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, '.' ))

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list