You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Linux u24vm 6.8.0-50-generic #51-Ubuntu SMP PREEMPT_DYNAMIC Sat Nov 9 17:58:29 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
net
What steps will reproduce the bug?
Setup a node instance,
» node
and run the following javascript code.
net = require('net');
s = new net.Socket(()=>{});
s.connect({port:250,localAddress:'string'});
s.connect('string', ()=>{});
Then the node instance occurs an abort.
How often does it reproduce? Is there a required condition?
This abort can always be triggered following the steps above.
What is the expected behavior? Why is that the expected behavior?
If any error occurs, an exception or similar error-reporting stuff should be thrown, caught, and handled correctly. There is no reason to abort the whole node process.
I think there are not valid arguments before we init the connection to the socket. There are less than args[2] given from the parameter that caused the segmentation fault. Should we add some validation here (?)
void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args) {
CHECK(args[2]->IsUint32());
// explicit cast to fit to libuv's type expectation
int port = static_cast<int>(args[2].As<Uint32>()->Value());
Connect<sockaddr_in>(args, [port](const char* ip_address, sockaddr_in* addr) {
return uv_ip4_addr(ip_address, port, addr);
});
}
Version
v22.11.0
Platform
Subsystem
net
What steps will reproduce the bug?
Setup a node instance,
and run the following javascript code.
Then the node instance occurs an abort.
How often does it reproduce? Is there a required condition?
This abort can always be triggered following the steps above.
What is the expected behavior? Why is that the expected behavior?
If any error occurs, an exception or similar error-reporting stuff should be thrown, caught, and handled correctly. There is no reason to abort the whole node process.
What do you see instead?
Additional information
No response
The text was updated successfully, but these errors were encountered: