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
Platform: Darwin macbook 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64
Subsystem: dgram
constdgram=require('dgram');constudpSocket=dgram.createSocket({type: 'udp4'});udpSocket.connect(1234,'127.0.0.1',(error)=>{console.log('UDP socket connected (error:%s)',String(error));// This is the proper way to send data on a connected UDP socket.// udpSocket.send('foo', (error) => console.log('error:', error));// This is for non connected UDP sockets. Anyway it should NOT produce an abort.udpSocket.send('foo',1234,'127.0.0.1',(error)=>console.log('error:',error));});
To clarify, the code above creates a UDP socket, connects it, and then uses the send() API by including the remote port and address (which are useless or even invalid in a connected UDP socket).
Not sure if send() should throw due the useless/invalid presence of port and address arguments, but it should not crash.
The text was updated successfully, but these errors were encountered:
This commit fixes a C++ abort for connected dgram sockets
by improving input validation in the JS layer.
Fixes: #28126
PR-URL: #28135
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
It produces:
To clarify, the code above creates a UDP socket, connects it, and then uses the send() API by including the remote
port
andaddress
(which are useless or even invalid in a connected UDP socket).Not sure if
send()
should throw due the useless/invalid presence ofport
andaddress
arguments, but it should not crash.The text was updated successfully, but these errors were encountered: