https://bugs.winehq.org/show_bug.cgi?id=57027
Bug ID: 57027 Summary: GetFinalPathNameByHandleW does not handle paths exceeding MAX_PATH (260 chars) Product: Wine Version: 9.0 Hardware: aarch64 OS: MacOS Status: UNCONFIRMED Severity: normal Priority: P2 Component: kernel32 Assignee: wine-bugs@winehq.org Reporter: wine@purisa.me
Hello,
I am writing a Rust program that calls canonicalize() on a path that is over 260 characters long. The Windows implementation of this function calls GetFinalPathNameByHandleW.
On Windows, this works just fine and returns a valid path. With Wine on macOS, the call returns a win32 error code ERROR_MORE_DATA (234, 0xEA). I re-ran the binary with WINEDEBUG=+relay and there is an NtStatus code STATUS_BUFFER_OVERFLOW (0x80000005) coming from NtQueryObject.
I believe this is because the buffer allocated in Wine's implementation of GetFinalPathNameByHandleW is not large enough for the ObjectInformation NtQueryObject is trying to return. Should GetFinalPathNameByHandleW fall back to a dynamically allocated buffer in this situation?
Thank you!
https://bugs.winehq.org/show_bug.cgi?id=57027
--- Comment #1 from Sameer Puri wine@purisa.me --- Created attachment 76877 --> https://bugs.winehq.org/attachment.cgi?id=76877 Relevant calls made when run with WINEDEBUG=+relay
https://bugs.winehq.org/show_bug.cgi?id=57027
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
http://bugs.winehq.org/show_bug.cgi?id=57027
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |bernhardu@mailbox.org
--- Comment #2 from Bernhard Übelacker bernhardu@mailbox.org --- Submitted merge request: https://gitlab.winehq.org/wine/wine/-/merge_requests/8240
http://bugs.winehq.org/show_bug.cgi?id=57027
Bernhard Übelacker bernhardu@mailbox.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED Fixed by SHA1| |e76a49ae4e056123eaf42febac9 | |8f3be298e51fb
--- Comment #3 from Bernhard Übelacker bernhardu@mailbox.org --- The merge request got accepted, so this bug should no longer appear with current git or the next release wine-10.14. Resolving fixed.
http://bugs.winehq.org/show_bug.cgi?id=57027
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 10.14.