Skip to content

Commit

Permalink
child_process: check array readability in spawn
Browse files Browse the repository at this point in the history
Co-authored-by: Jake Yuesong Li <[email protected]>
  • Loading branch information
jazelly and jakecastelli committed Jan 18, 2025
1 parent 99099d6 commit e9296b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ function stdioStringToArray(stdio, channel) {
throw new ERR_INVALID_ARG_VALUE('stdio', stdio);
}

for (let i = 0; i < options.length; i++) {
const stream = options[i];
if (stream == null) {
throw new ERR_INVALID_ARG_VALUE('stdio', options);
}
}

if (channel) ArrayPrototypePush(options, channel);

return options;
Expand Down

0 comments on commit e9296b7

Please sign in to comment.