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 lib: move Symbol[Async]Dispose polyfills to internal/util 2024-09-14 00:20:34 +02:00
compose.js lib: replace spread operator with primordials function 2024-08-14 08:37:01 +02:00
destroy.js lib: enforce ASCII order in error code imports 2024-04-29 22:46:29 +02:00
duplex.js lib: prefer logical assignment 2024-11-27 11:03:39 -05:00
duplexify.js lib: replace createDeferredPromise util with Promise.withResolvers 2024-11-27 11:03:39 -05:00
duplexpair.js stream: expose DuplexPair API 2024-08-05 11:15:45 -03:00
end-of-stream.js stream: use new AsyncResource instead of bind 2025-10-07 17:29:37 +02:00
from.js lib: prefer optional chaining 2024-10-04 10:20:24 +02:00
lazy_transform.js
legacy.js stream: fix eventNames() to not return not defined events 2024-02-27 23:56:43 +00:00
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 stream: bump default highWaterMark 2024-03-13 19:02:14 +00:00
transform.js lib: fix typos in comments within internal/streams 2024-08-14 08:14:51 +02:00
utils.js lib: prefer optional chaining 2024-10-04 10:20:24 +02:00
writable.js Revert "lib: optimize writable stream buffer clearing" 2025-09-20 06:17:14 +00:00