diff options
author | cjihrig <cjihrig@gmail.com> | 2015-02-23 11:23:53 -0500 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-03-05 10:01:15 -0500 |
commit | 9d2b89d06c14f8e250e290668507c9daa8ec97ca (patch) | |
tree | 81845bb4fcbb4c1d14dd61c6cbfd0465ba2c1ebb /src | |
parent | 31421afe897635bd86201c2e677fb881b57a892c (diff) | |
download | android-node-v8-9d2b89d06c14f8e250e290668507c9daa8ec97ca.tar.gz android-node-v8-9d2b89d06c14f8e250e290668507c9daa8ec97ca.tar.bz2 android-node-v8-9d2b89d06c14f8e250e290668507c9daa8ec97ca.zip |
net: allow port 0 in connect()
The added validation allows non-negative numbers and numeric
strings. All other values result in a thrown exception.
Fixes: https://github.com/joyent/node/issues/9194
PR-URL: https://github.com/joyent/node/pull/9268
Reviewed-By: Julien Gilli <julien.gilli@joyent.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/tcp_wrap.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 202053e837..e16e140583 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -350,7 +350,7 @@ void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args) { CHECK(args[0]->IsObject()); CHECK(args[1]->IsString()); - CHECK(args[2]->Uint32Value()); + CHECK(args[2]->IsUint32()); Local<Object> req_wrap_obj = args[0].As<Object>(); node::Utf8Value ip_address(env->isolate(), args[1]); @@ -381,7 +381,7 @@ void TCPWrap::Connect6(const FunctionCallbackInfo<Value>& args) { CHECK(args[0]->IsObject()); CHECK(args[1]->IsString()); - CHECK(args[2]->Uint32Value()); + CHECK(args[2]->IsUint32()); Local<Object> req_wrap_obj = args[0].As<Object>(); node::Utf8Value ip_address(env->isolate(), args[1]); |