mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
net: validate non-string host for socket.connect
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com> PR-URL: https://github.com/nodejs/node/pull/57198 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
38989b070a
commit
e56ca1a3f2
2 changed files with 14 additions and 0 deletions
|
@ -1311,6 +1311,8 @@ function lookupAndConnect(self, options) {
|
|||
const host = options.host || 'localhost';
|
||||
let { port, autoSelectFamilyAttemptTimeout, autoSelectFamily } = options;
|
||||
|
||||
validateString(host, 'options.host');
|
||||
|
||||
if (localAddress && !isIP(localAddress)) {
|
||||
throw new ERR_INVALID_IP_ADDRESS(localAddress);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue