-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.dgramIssues and PRs related to the dgram subsystem / UDP.Issues and PRs related to the dgram subsystem / UDP.
Description
#4374 introduces a bug: it makes socket.send()
accept an array but it's not resilient against that array getting modified afterwards:
$ node -e '
var a = ["boom!"], s = dgram.createSocket("udp4");
s.send(a, 1234);
a.splice(0);
'
node: ../deps/uv/src/unix/udp.c:390: uv__udp_send: Assertion `nbufs > 0' failed.
Aborted (core dumped)
A secondary issue with #4374 is that it penalizes the common case of passing in a buffer by always wrapping it in an array.
Metadata
Metadata
Assignees
Labels
confirmed-bugIssues with confirmed bugs.Issues with confirmed bugs.dgramIssues and PRs related to the dgram subsystem / UDP.Issues and PRs related to the dgram subsystem / UDP.