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

fix: remove use of from_utf8_unchecked in macos process handling #1257

Commits on Apr 18, 2024

  1. fix: remove use of from_utf8_unchecked in macos process handling

    Those unsafe functions have been observed to not respect their safety
    constraints, as some values retrieved from the macos API are not
    guaranteed to be UTF-8.
    
    This is fixed by replacing those calls with `from_utf8_lossy`, which
    will replace those values with a replacement character to ensure the
    generated String is valid.
    
    This solution is not ideal, but the master branch contains the better
    fix: an OsString is returned to let the caller decide how to handle the
    value.
    
    Changing those calls remove the need of unsafe blocks, so those were
    removed at the same time.
    vthib committed Apr 18, 2024
    Configuration menu
    Copy the full SHA
    1bca13a View commit details
    Browse the repository at this point in the history