Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader: replace stray MAX_PATH with PATH_MAX #5617

Merged
merged 3 commits into from Mar 11, 2021

Commits on Mar 8, 2021

  1. tests: add a test with a long filename in onefile build

    Test whether filenames with paths longer than 260 (MAX_PATH on Windows)
    are properly extracted from onefile build's CArchive.
    rokm committed Mar 8, 2021
    Copy the full SHA
    27d4fa7 View commit details
    Browse the repository at this point in the history
  2. 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).
    rokm committed Mar 8, 2021
    Copy the full SHA
    fc294f4 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2021

  1. Copy the full SHA
    dc4673e View commit details
    Browse the repository at this point in the history