diff options
author | Chuck Langford <field.email@gmail.com> | 2015-12-30 16:27:56 -0500 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-06-30 16:14:55 -0700 |
commit | 99cfd53097ef646e0e61a0690c9b80ff9ae80d68 (patch) | |
tree | bc39846c63ef7625b6004faca4c2623748a38572 /lib/child_process.js | |
parent | 0548e5d12ac32b6d58c8aac8bcf4dc8cff708b1f (diff) | |
download | android-node-v8-99cfd53097ef646e0e61a0690c9b80ff9ae80d68.tar.gz android-node-v8-99cfd53097ef646e0e61a0690c9b80ff9ae80d68.tar.bz2 android-node-v8-99cfd53097ef646e0e61a0690c9b80ff9ae80d68.zip |
test: test execFile/fork arg validation
Fixes: https://github.com/nodejs/node/issues/2681
Refs: https://github.com/nodejs/node/pull/4508
PR-URL: https://github.com/nodejs/node/pull/7399
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib/child_process.js')
-rw-r--r-- | lib/child_process.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/child_process.js b/lib/child_process.js index d9be799258..003f6569fa 100644 --- a/lib/child_process.js +++ b/lib/child_process.js @@ -23,11 +23,11 @@ exports.fork = function(modulePath /*, args, options*/) { var options = {}; var args = []; var pos = 1; - if (Array.isArray(arguments[pos])) { + if (pos < arguments.length && Array.isArray(arguments[pos])) { args = arguments[pos++]; } - if (arguments[pos] != null) { + if (pos < arguments.length && arguments[pos] != null) { if (typeof arguments[pos] !== 'object') { throw new TypeError('Incorrect value of args option'); } else { |