diff options
| author | JJ Liebig <jonathan.liebig@gmail.com> | 2026-09-01 23:14:22 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-01 21:14:22 +0200 |
| commit | 5616196942cbe752cc0659b9bd0fb616b2a6ed5c (patch) | |
| tree | 89ffcbfe715498265bc6728e5450b66668385121 /vendor/portable-pty.patches.md | |
| parent | e2b85c73615b37a483eefa839923d9aff8e629b3 (diff) | |
fix(windows): reject malformed process environments (#3500)
* fix(windows): reject malformed process environments
refs #3430
* fix(windows): validate registry environment strings
refs #3430
* fix(windows): preserve hidden environment variables
refs #3430
Diffstat (limited to 'vendor/portable-pty.patches.md')
| -rw-r--r-- | vendor/portable-pty.patches.md | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/vendor/portable-pty.patches.md b/vendor/portable-pty.patches.md index 8ed47a65..14eae869 100644 --- a/vendor/portable-pty.patches.md +++ b/vendor/portable-pty.patches.md @@ -84,3 +84,48 @@ python3 -m unittest scripts.test_vendor_portable_pty ``` On Windows, also run `cargo test raw_arg_appends_unescaped_windows_command_tail`. + +## 0003 reject malformed Windows environments + +status: active + +patch: `vendor/patches/portable-pty/0003-reject-malformed-windows-environments.patch` + +herdr issue: https://github.com/herdrdev/herdr/issues/3430 + +upstream discussions: + +- https://github.com/wezterm/wezterm/issues/4364 +- https://github.com/warpdotdev/warp/commit/2992d02e3e38af697c83a3bd6f20003f54ffe066 + +upstream pr: none + +vendored base: `portable-pty 0.9.0` + +local files: + +- `vendor/portable-pty/src/cmdbuilder.rs` + +reason: Windows process environments may contain a registry value with an +empty name or a non-string type. `winreg 0.10` converts `REG_MULTI_SZ` to an +`OsString` that can contain embedded nulls. `portable-pty` serialized those +values unchanged, producing an invalid environment block that makes +`CreateProcessW` fail with `ERROR_INVALID_PARAMETER` (87). Import only Windows +environment string types and omit entries that cannot form one complete +`name=value\0` record. + +remove when: upstream `portable-pty` both imports only valid Windows environment +string types and prevents malformed names or values from corrupting the process +environment block, or Herdr replaces this launch path. + +verification: + +```sh +python3 -m unittest scripts.test_vendor_portable_pty +``` + +On Windows, also run: + +```sh +cargo test --manifest-path vendor/portable-pty/Cargo.toml windows_environment_rejects_malformed_entries +``` |
