node/lib/internal/streams
Thomas Watson 57c3035fec
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: https://github.com/nodejs/node/pull/61884
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2026-05-11 16:10:16 +02:00
..
add-abort-signal.js
compose.js
destroy.js
duplex.js lib: prefer logical assignment 2024-11-27 11:03:39 -05:00
duplexify.js
duplexpair.js
end-of-stream.js stream: use new AsyncResource instead of bind 2025-10-07 17:29:37 +02:00
from.js
lazy_transform.js
legacy.js
operators.js stream: replace manual function validation with validateFunction 2025-09-20 06:16:16 +00:00
passthrough.js
pipeline.js lib: prefer logical assignment 2024-11-27 11:03:39 -05:00
readable.js stream: fix decoded fromList chunk boundary check 2026-05-11 16:10:16 +02:00
state.js
transform.js
utils.js
writable.js Revert "lib: optimize writable stream buffer clearing" 2025-09-20 06:17:14 +00:00