Commit 34514e2
authored
fix: Preserve vt100 cell byte counts (#13058)
## Why
Fixes Linear issue VULN-11597. `turborepo-vt100` could store more than
15 UTF-8 bytes in a cell while reading the byte count through a 4-bit
mask, allowing `Cell::contents()` to slice in the middle of a multi-byte
codepoint.
## What
Preserve the full stored byte count for cell contents and replace
unchecked UTF-8 conversion with checked decoding that treats invalid
contents as an unreachable invariant violation.
## How
Added regression coverage for a single cell containing one 3-byte base
codepoint plus five 3-byte combining marks. Verified with:
- `cargo fmt --check`
- `cargo test -p turborepo-vt100`
- `cargo clippy -p turborepo-vt100 --all-targets --all-features`
Pre-push hooks also ran successfully during `git push`.1 parent 24e2d34 commit 34514e2
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
126 | 127 | | |
127 | 128 | | |
128 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
97 | 106 | | |
98 | 107 | | |
99 | 108 | | |
| |||
0 commit comments