Commit c14e98b4 authored by Matteo Collina's avatar Matteo Collina
Browse files

dgram: copy the list in send

This commit fix a possible crash situation in dgram send().
A crash is possible if an array is passed, and then altered after the
send call, as the call to libuv is wrapped in process.nextTick().
It also avoid sending an empty array to libuv by allocating an empty
buffer. It also does some cleanup inside send() to increase readability.

It removes test flakyness by use common.mustCall and
common.platformTimeout. Fixes situations were some events were not
asserted to be emitted.

Fixes: https://github.com/nodejs/node/issues/6616
PR-URL: https://github.com/nodejs/node/pull/6804


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
parent f9ea52e5
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment