• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

c-ares / c-ares / 28687780094
90%

Build:
DEFAULT BRANCH: main
Ran 03 Jul 2026 11:32PM UTC
Jobs 1
Files 177
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Jul 2026 11:29PM UTC coverage: 91.595% (+0.03%) from 91.564%
28687780094

push

github

web-flow
ares_getaddrinfo: handle NULL node per POSIX and implement ARES_AI_PASSIVE (#1186)

`ares_getaddrinfo()` dereferenced the `name` (node) argument with no
NULL check, so calling it with a NULL name crashed in `fake_addrinfo()`
(issue #1035).

Per POSIX, a NULL node is valid as long as a service is provided — the
returned addresses are then synthesized from the service:

- **`ARES_AI_PASSIVE` set** → wildcard address (`0.0.0.0` / `::`),
suitable for `bind()`ing a listening socket.
- **not set** → loopback address (`127.0.0.1` / `::1`), for connecting
to a peer on the local host.
- **both node and service NULL** → `ARES_ENOTFOUND` (POSIX
`EAI_NONAME`).

`ARES_AI_PASSIVE` was already declared in the public API and included in
`ARES_AI_MASK`, but had no implementation. It is now honored.

### Changes
- Guard the both-NULL case with `ARES_ENOTFOUND`.
- Synthesize wildcard/loopback nodes honoring `ai_family`,
`ai_socktype`, `ai_protocol` when `name` is NULL.
- Defensive NULL guard in `fake_addrinfo()`.
- Document NULL-node behavior and the `ARES_AI_PASSIVE` flag in
`ares_getaddrinfo.3`.
- Tests: loopback, passive/wildcard, `AF_INET`/`AF_INET6` selection, and
the both-NULL error case.

All 1074 non-live tests pass locally.

Fixes #1035

Signed-off-by: Brad House <brad@brad-house.com>

98 of 100 new or added lines in 2 files covered. (98.0%)

4 existing lines in 4 files now uncovered.

23909 of 26103 relevant lines covered (91.59%)

12336.16 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
99.34
-0.4% test/ares-test-misc.cc

Coverage Regressions

Lines Coverage ∆ File
1
95.55
-0.4% src/lib/ares_init.c
1
86.05
-0.58% src/lib/dsa/ares_array.c
1
88.28
-0.09% src/lib/record/ares_dns_record.c
1
92.7
-0.15% src/lib/str/ares_buf.c
Jobs
ID Job ID Ran Files Coverage
1 28687780094.1 03 Jul 2026 11:31PM UTC 940
61.4
GitHub Action Run
Source Files on build 28687780094
  • Tree
  • List 177
  • Changed 61
  • Source Changed 0
  • Coverage Changed 61
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 7edb590f on github
  • Prev Build on main (#28687754304)
  • Next Build on main (#28688115491)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc