diff options
author | Tobias Nießen <tniessen@tnie.de> | 2022-08-25 23:32:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-25 23:32:14 +0300 |
commit | 15aa34b20aadeecf61befc39c117e3f707dd8900 (patch) | |
tree | b18cdfb9d8b748b54ed0eea9899cda1d0e43caee /src | |
parent | 4d49d6507e33c8f01de96488e9be6fdaee059d55 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/inspector_js_api.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index dd05a5b9c3f..4d675da4719 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -281,6 +281,7 @@ void Open(const FunctionCallbackInfo<Value>& args) { if (args.Length() > 0 && args[0]->IsUint32()) { uint32_t port = args[0].As<Uint32>()->Value(); + CHECK_LE(port, std::numeric_limits<uint16_t>::max()); ExclusiveAccess<HostPort>::Scoped host_port(agent->host_port()); host_port->set_port(static_cast<int>(port)); } |