Skip to content

RESOLV: handle empty addr list properly#8773

Merged
alexey-tikhonov merged 1 commit into
SSSD:masterfrom
alexey-tikhonov:empty-alias
Jun 4, 2026
Merged

RESOLV: handle empty addr list properly#8773
alexey-tikhonov merged 1 commit into
SSSD:masterfrom
alexey-tikhonov:empty-alias

Conversation

@alexey-tikhonov

Copy link
Copy Markdown
Member

The address list can be NULL or empty when '/etc/hosts' has an IPv6 only entry and IPv4 was requested or vice versa. It was treated as an indicator that the name component contains the path to an LDAPI socket, leading to a crash.

@alexey-tikhonov

Copy link
Copy Markdown
Member Author

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a check in resolv_gethostbyname_files_send to handle cases where the address list (state->rhostent->addr_list) is NULL or empty, which can occur when /etc/hosts contains only an IPv6 entry and IPv4 was requested (or vice versa). In such cases, the code now frees the host entry, sets the status to ARES_ENODATA, and returns an ENOENT error. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@alexey-tikhonov
alexey-tikhonov marked this pull request as ready for review June 4, 2026 09:37

@ikerexxe ikerexxe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread src/resolv/async_resolv.c Outdated

@sumit-bose sumit-bose left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

thank you for the fix, ACK.

bye,
Sumit

The address list can be NULL or empty when '/etc/hosts' has
an IPv6 only entry and IPv4 was requested or vice versa. It
was treated as an indicator that the name component contains
the path to an LDAPI socket, leading to a crash.

Reviewed-by: Iker Pedrosa <[email protected]>
Reviewed-by: Sumit Bose <[email protected]>
@sssd-bot

sssd-bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The pull request was accepted by @alexey-tikhonov with the following PR CI status:


🟢 CodeQL (success)
🟢 osh-diff-scan:fedora-rawhide-x86_64:upstream (success)
🟢 rpm-build:centos-stream-10-x86_64:upstream (success)
🟢 rpm-build:fedora-43-x86_64:upstream (success)
🟢 rpm-build:fedora-44-x86_64:upstream (success)
🟢 rpm-build:fedora-rawhide-x86_64:upstream (success)
🟢 testing-farm:fedora-43-x86_64:upstream (success)
🟢 testing-farm:fedora-44-x86_64:centos-stream-10 (success)
🟢 testing-farm:fedora-44-x86_64:upstream (success)
🔴 testing-farm:fedora-rawhide-x86_64:upstream (failure)
🟢 Analyze (target) / cppcheck (success)
🟢 Build / freebsd (success)
🟢 Build / make-distcheck (success)
🔴 ci / intgcheck (centos-10) (failure)
🟢 ci / intgcheck (fedora-43) (success)
🟢 ci / intgcheck (fedora-44) (success)
🟢 ci / intgcheck (fedora-45) (success)
🟢 ci / prepare (success)
🔴 ci / system (centos-10) (failure)
🟢 ci / system (fedora-43) (success)
🔴 ci / system (fedora-44) (failure)
🔴 ci / system (fedora-45) (failure)
➖ Coverity scan / coverity (skipped)
🟢 Static code analysis / codeql (success)
🟢 Static code analysis / pre-commit (success)
🟢 Static code analysis / python-system-tests (success)


There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging.

@alexey-tikhonov
alexey-tikhonov merged commit b6e7f05 into SSSD:master Jun 4, 2026
10 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants