-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dns: handle array holes in setServers() #8567
Conversation
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.
LGTM
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.
LGTM
@cjihrig any objections for landing this? |
I was waiting for the CI to clear up to get a better run. Feel free to land it. Otherwise, I'll try to get to it this evening. |
|
Is this semver-minor or semver-patch? |
@ChALkeR should I stop landing? Was about to push when you posted your comment. |
Since I think we usually equate failing |
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.
LGTM
This commit adds better handling of exceptional array formats passed to dns.setServers(). Prior to this commit, the input array was validated using map(), which preserves holes, allowing them to be passed to c-ares, crashing Node. This commit replaces map() with forEach(), which skips holes. Fixes: nodejs#8538 PR-URL: nodejs#8567 Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
the original test does not dump core on v4.x @cjihrig let me know if this should be backported, labeling as don't land for now |
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
dns
Description of change
This commit adds better handling of exceptional array formats passed to
dns.setServers()
. Prior to this commit, the input array was validated usingmap()
, which preserves holes, allowing them to be passed to c-ares, crashing Node. This commit replacesmap()
withforEach()
, which skips holes.Tests taken from #8538. Fixes #8538