Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bootloader: replace stray MAX_PATH with PATH_MAX
On Windows, `pyi_path_fopen()` erroneously uses `MAX_PATH` (260) instead of `PATH_MAX` (4096) to convert the filename to wide characters, which causes `MultiByteToWideChar()` call in `pyi_win32_utils_from_utf8()` to fail with ``` MultiByteToWideChar: The data area passed to a system call is too small. ``` when we try to open a file with a long filename (> 260). Due to lack of error checking, the resulting `wfilename` array ends up with random content, and the `_wfopen()` call either fails (in read-only mode) or creates a randomly-named file (in write mode). Fixes #5615.
- Loading branch information