Skip to content

host_env: Reject interior NULs for CreateProcessW - #8555

Merged
youknowone merged 1 commit into
RustPython:mainfrom
joshuamegnauth54:host_env-clippy-and-unneeded-fn
Aug 19, 2026
Merged

host_env: Reject interior NULs for CreateProcessW#8555
youknowone merged 1 commit into
RustPython:mainfrom
joshuamegnauth54:host_env-clippy-and-unneeded-fn

Conversation

@joshuamegnauth54

@joshuamegnauth54 joshuamegnauth54 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reject interior NULs for Windows' CreateProcessW.

Summary by CodeRabbit

  • Bug Fixes
    • Improved validation of process command lines and environment blocks.
    • Invalid command-line buffers now return a clear input error instead of being processed.
    • Ensured environment data is properly terminated before process creation.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 94b2c2be-be5f-4cd1-8812-4c9067686730

📥 Commits

Reviewing files that changed from the base of the PR and between 419a0b2 and ac1a932.

📒 Files selected for processing (1)
  • crates/host_env/src/winapi.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The Windows process creation path now converts command-line buffers into validated WideCStr values, checks environment block termination inline, and passes the validated command line to the raw wrapper.

Changes

Windows process input validation

Layer / File(s) Summary
Validated process creation
crates/host_env/src/winapi.rs
The raw wrapper accepts WideCStr command lines. create_process maps invalid command-line termination to InvalidInput and checks for double-NUL environment termination. Obsolete validation helpers were removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to ac1a9

The change rejects interior NULs before Windows process creation, preventing invalid inputs from being passed through. No actionable merge-blocking risk remains beyond completing the normal formatting and lint checks.

Possibly related PRs

Suggested reviewers: youknowone

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: rejecting interior NUL characters in Windows CreateProcessW handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@joshuamegnauth54

Copy link
Copy Markdown
Contributor Author

Clippy will pass after #8554 is merged. 😁

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@youknowone
youknowone merged commit ebc0459 into RustPython:main Aug 19, 2026
27 of 28 checks passed
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.

2 participants