Commit 57c3035
stream: fix decoded fromList chunk boundary check
Correct `fromList()` in decoded string mode to compare `n` against the
current chunk length, not the buffer array length.
This prevents over-consuming chunks, which can corrupt readable state
and crash with `TypeError` when mixing `setEncoding()` and `read(n)`.
PR-URL: #61884
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Ilyas Shabi <[email protected]>
Reviewed-By: Gürgün Dayıoğlu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>1 parent ecfa766 commit 57c3035
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1633 | 1633 | | |
1634 | 1634 | | |
1635 | 1635 | | |
1636 | | - | |
| 1636 | + | |
1637 | 1637 | | |
1638 | 1638 | | |
1639 | 1639 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments