summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net.js')
-rw-r--r--lib/net.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js
index 0f80b41897..2f341f53a1 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -75,7 +75,7 @@ const {
ERR_SOCKET_BAD_PORT,
ERR_SOCKET_CLOSED
} = errors.codes;
-
+const { validateInt32 } = require('internal/validators');
const kLastWriteQueueSize = Symbol('lastWriteQueueSize');
// Lazy loaded to improve startup performance.
@@ -93,6 +93,7 @@ const {
function noop() {}
function createHandle(fd, is_server) {
+ validateInt32(fd, 'fd', 0);
const type = TTYWrap.guessHandleType(fd);
if (type === 'PIPE') {
return new Pipe(