diff options
author | Sam Roberts <sam@strongloop.com> | 2014-09-29 11:26:43 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-11-18 16:20:21 -0800 |
commit | 70dafa7b624abd43432e03304d65cc527fbecc11 (patch) | |
tree | 2db5089cd92c2aa5ed2242f936b3554a121de019 /lib | |
parent | e17c5a72b23f920f291d61f2780068c18768cb92 (diff) | |
download | node-70dafa7b624abd43432e03304d65cc527fbecc11.tar.gz |
child_process: check fork args is an array
Optional fork args should be type-checked with same behaviour as the
equivalent argument to spawn.
PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/child_process.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/child_process.js b/lib/child_process.js index 53e0bb24f..640f68e61 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -525,6 +525,8 @@ exports.fork = function(modulePath /*, args, options*/) { if (Array.isArray(arguments[1])) { args = arguments[1]; options = util._extend({}, arguments[2]); + } else if (arguments[1] && typeof arguments[1] !== 'object') { + throw new TypeError('Incorrect value of args option'); } else { args = []; options = util._extend({}, arguments[1]); |