FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

dns: validate port range in `setServers()` by Renegade334 · Pull Request #65021 · nodejs/node · GitHub

/ node Public

dns: validate port range in setServers() - #65021

Merged
Renegade334 merged 1 commit into
nodejs:mainfrom
Renegade334:dns-validate-setservers-ports
Aug 7, 2026
Merged

dns: validate port range in setServers()#65021
Renegade334 merged 1 commit into
nodejs:mainfrom
Renegade334:dns-validate-setservers-ports

Conversation

Copy link
Copy Markdown
Member

As per #65009 (review).

dns.setServers() currently has the following shenanigans with out-of-range port numbers:

  • uint16 overflow (seems version-/platform-dependent)
    dns.setServers(['1.2.3.4:65535', '1.2.3.4:65536', '1.2.3.4:65537'])
    dns.getServers()
    [ '1.2.3.4:65535', '1.2.3.4', '1.2.3.4:1' ]
  • process crash if >INT_MAX
    dns.setServers(['1.1.1.1:99999999999999999999999999'])
    // #  node[1673753]: void node::cares_wrap::(anonymous namespace)::SetServers(const FunctionCallbackInfo<Value> &) at ../src/cares_wrap.cc:2164
    // #  Assertion failed: portValue->Int32Value(env->context()).FromJust()

(the latter of these is not addressed by #65009)

Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/net

nodejs-github-bot added dns Issues and PRs related to the dns subsystem. needs-ci PRs that need a full CI run. labels Aug 4, 2026
Renegade334 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Aug 4, 2026

codecov Bot commented Aug 4, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (1576cb8) to head (16f5b73).
⚠️ Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65021      +/-   ##
==========================================
- Coverage   90.30%   90.30%   -0.01%     
==========================================
  Files         759      759              
  Lines      247634   247636       +2     
  Branches    46684    46697      +13     
==========================================
- Hits       223630   223629       -1     
- Misses      15467    15468       +1     
- Partials     8537     8539       +2     
Files with missing lines Coverage Δ
lib/internal/dns/utils.js 99.44% <100.00%> (+<0.01%) ⬆️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 4, 2026

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

Renegade334 added the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 5, 2026
Renegade334 merged commit e2d7b34 into nodejs:main Aug 7, 2026
86 of 89 checks passed
Renegade334 deleted the dns-validate-setservers-ports branch August 7, 2026 13:06
Renegade334 removed the commit-queue Add this label to land a pull request using GitHub Actions. label Aug 7, 2026

Copy link
Copy Markdown
Member Author

Landed in e2d7b34

aduh95 pushed a commit that referenced this pull request Aug 13, 2026
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: #65021
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: #65021
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. dns Issues and PRs related to the dns subsystem. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL