[Bug 51833] New: GetModuleFileNameW no longer works with large buffers

WineHQ Bugzilla wine-bugs at winehq.org
Sun Oct 3 11:40:57 CDT 2021


https://bugs.winehq.org/show_bug.cgi?id=51833

            Bug ID: 51833
           Summary: GetModuleFileNameW no longer works with large buffers
           Product: Wine
           Version: unspecified
          Hardware: x86-64
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: kernel32
          Assignee: wine-bugs at winehq.org
          Reporter: wine at 2ar.nl
   Regression SHA1: 43d14fd808bb965762bb6c76027bbe26ba936f82
      Distribution: ---

The recent change 'Implement kernelbase.GetModuleFileNameW using
ntdll.LdrGetDllFullName' (bug 49344) broke passing large buffers (>=32768
characters) to GetModuleFileNameW, as done by cygwin.

Possible fix:

     name.MaximumLength = (size < 0xffff / sizeof(WCHAR) ? size : 0xffff /
sizeof(WCHAR)) * sizeof(WCHAR);

Comment from Nikolay Sivov: we could probably min() it in ints, to avoid this
16bit overflow.

-- 
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