Skip to content

Commit

Permalink
child_process: don't send invalid handles over IPC
Browse files Browse the repository at this point in the history
  • Loading branch information
cjihrig committed May 23, 2017
1 parent 7a1dc1f commit b0337d8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/internal/child_process.js
Original file line number Diff line number Diff line change
Expand Up @@ -610,10 +610,12 @@ function setupChannel(target, channel) {
handle,
options);

// If handle was sent twice, or it is impossible to get native handle
// out of it - just send a text without the handle.
if (!handle)
message = message.msg;
// If it is impossible to get a handle, then something unexpected likely
// happened. For example, a socket may have closed while waiting in the
// _handleQueue.
if (!handle) {
return true;
}

// Update simultaneous accepts on Windows
if (obj.simultaneousAccepts) {
Expand Down

0 comments on commit b0337d8

Please sign in to comment.