Skip to content

Conversation

@jrflat
Copy link
Contributor

@jrflat jrflat commented Aug 2, 2024

Explanation: Prevents a null-terminator from the Windows home directory API from ending up in the resulting String or URL. Prevents %00 from being decoded to \0 when getting a URL's fileSystemPath, which is often converted to a C string for file system calls.
Scope: Windows-only change from String(decoding:) to String(decodingCString:) for homeDirectoryPath(forUser:). Not decoding %00 occurs for file paths of URLs on all platforms.
Original PR: #808
Risk: Low. Minor changes to prevent unexpected behavior when null-characters are included in file paths. The respective Windows APIs null-terminate their output, so String(decodingCString:) is safe.
Testing: swift-ci testing and local testing on Windows
Reviewers: @compnerd @jmschonfeld

@jrflat
Copy link
Contributor Author

jrflat commented Aug 2, 2024

@swift-ci please test

@jrflat jrflat requested review from itingliu and parkera August 2, 2024 16:30
@jrflat jrflat merged commit 40ca820 into swiftlang:release/6.0 Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants