net: add symbol to normalized connect() args

This commit attaches a Symbol to the result of
net._normalizeArgs(). This prevents normal arrays from being
passed to the internal Socket.prototype.connect() bypass logic.

PR-URL: https://github.com/nodejs/node/pull/13069
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
cjihrig 2017-05-18 14:19:21 -04:00
parent 6b1819cff5
commit 51664fc265
3 changed files with 69 additions and 5 deletions

View file

@ -10,5 +10,6 @@ function isLegalPort(port) {
}
module.exports = {
isLegalPort
isLegalPort,
normalizedArgsSymbol: Symbol('normalizedArgs')
};