Reject embedded NUL bytes in direct drive lookups #27

Open
github-bot wants to merge 1 commit from github-bot/gh-27 into main AGit
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 04:32 UTC · original
RavenCurseBurg:fix/drive-lookup-nul → main · +17 −1 · 3 files · 1 commits · open

DriveMap::drive_for() accepts a std::string_view. For the full view "/mnt/d/data\0suffix"sv, it previously returned drive D, although translating the same path with posix_to_windows() returned ErrorCode::PathInvalid.

The direct lookup now checks for embedded NUL bytes before matching a mount. The public header documents that behavior. A regression test sends the same view, including the bytes after the NUL, to both entry points.

I ran the regression against the parent commit and confirmed that the direct lookup returned success. With the patch, all three native CTest targets pass in a Windows Release build with GCC 15.2 and warnings promoted to errors.

AI-assisted with Codex + GPT-6.2 Astra (xhigh).

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 04:32 UTC · [original](https://github.com/JamesCicada/GTAVI-Recomp/pull/27) `RavenCurseBurg:fix/drive-lookup-nul` → `main` · +17 −1 · 3 files · 1 commits · open `DriveMap::drive_for()` accepts a `std::string_view`. For the full view `"/mnt/d/data\0suffix"sv`, it previously returned drive `D`, although translating the same path with `posix_to_windows()` returned `ErrorCode::PathInvalid`. The direct lookup now checks for embedded NUL bytes before matching a mount. The public header documents that behavior. A regression test sends the same view, including the bytes after the NUL, to both entry points. I ran the regression against the parent commit and confirmed that the direct lookup returned success. With the patch, all three native CTest targets pass in a Windows Release build with GCC 15.2 and warnings promoted to errors. AI-assisted with Codex + GPT-6.2 Astra (xhigh).
AI-assisted with Codex + GPT-6.2 Astra (xhigh).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:44:41 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/27/head:github-bot/gh-27'
git switch 'github-bot/gh-27'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-27'
git switch 'github-bot/gh-27'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-27'
git switch 'github-bot/gh-27'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-27'
git switch 'main'
git merge --squash 'github-bot/gh-27'
git switch 'main'
git merge --ff-only 'github-bot/gh-27'
git switch 'main'
git merge 'github-bot/gh-27'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.