mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
inspector: prevent integer overflow in open()
PR-URL: https://github.com/nodejs/node/pull/44367 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
This commit is contained in:
parent
4d49d6507e
commit
15aa34b20a
3 changed files with 27 additions and 0 deletions
17
test/parallel/test-inspector-open-port-integer-overflow.js
Normal file
17
test/parallel/test-inspector-open-port-integer-overflow.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
'use strict';
|
||||
|
||||
// Regression test for an integer overflow in inspector.open() when the port
|
||||
// exceeds the range of an unsigned 16-bit integer.
|
||||
|
||||
const common = require('../common');
|
||||
common.skipIfInspectorDisabled();
|
||||
common.skipIfWorker();
|
||||
|
||||
const assert = require('assert');
|
||||
const inspector = require('inspector');
|
||||
|
||||
assert.throws(() => inspector.open(99999), {
|
||||
name: 'RangeError',
|
||||
code: 'ERR_OUT_OF_RANGE',
|
||||
message: 'The value of "port" is out of range. It must be >= 0 && <= 65535. Received 99999'
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue