Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

dgram: send("xxx") triggers assert() #4496

@bnoordhuis

Description

@bnoordhuis
$ out/Release/node -e 'require("dgram").createSocket("udp4").send("BAM")'
node: ../../src/udp_wrap.cc:220: static v8::Handle<v8::Value> node::UDPWrap::DoSend(const v8::Arguments&, int): Assertion `Buffer::HasInstance(args[0])' failed.
Aborted (core dumped)

Quick fix: sanity-check arguments before passing them on to UDPWrap::DoSend(). Maybe convert strings to buffers.

Long-term fix: support sending strings; we can optimize that a great deal in the binding layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions