Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
udp: use libuv API to get file descriptor
Refs: #6838 PR-URL: #6908 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
- Loading branch information
3ef2eb2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for future note, this change will not prevent the application from aborting if the internal pointer hasn't yet been set b/c by default it's filled with garbage and not manually null-ed out. I have a fix for this in #6184.
3ef2eb2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trevnorris you mean
wrap->handle_
contains garbage? In that case no, this doesn't take care of that.3ef2eb2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saghul I mean that
wrap != nullptr
will return true even ifWrap()
hasn't run on the class yet, because the v8::Object's internal slot will contain garbage. Thus accessingwrap->handle_
will cause the process to abort because the returned pointer is invalid.3ef2eb2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ouch. I wasn't aware of this.