[autobackport: sssd-2-13] RESOLV: handle empty addr list properly#8775
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a check to handle cases where the address list (h_addr_list) returned from resolv_gethostbyname_files_send is NULL or empty, preventing potential issues when /etc/hosts has mismatched IP version entries. The reviewer suggests a defensive programming improvement to also check if hostent itself is NULL before dereferencing it, which prevents potential crashes in unexpected edge cases.
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.
ikerexxe
left a comment
There was a problem hiding this comment.
LGTM. I wouldn't worry too much about Gemini's comment
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 <ipedrosa@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> (cherry picked from commit b6e7f05)
|
The pull request was accepted by @alexey-tikhonov with the following PR CI status: 🟢 rpm-build:centos-stream-10-x86_64:upstream (success) There are unsuccessful or unfinished checks. Make sure that the failures are not related to this pull request before merging. |
833cfb8 to
327e7b0
Compare
This is an automatic backport of PR#8773 RESOLV: handle empty addr list properly to branch sssd-2-13, created by @alexey-tikhonov.
Please make sure this backport is correct.
Note
The commits were cherry-picked without conflicts.
You can push changes to this pull request
Original commits
b6e7f05 - RESOLV: handle empty addr list properly
Backported commits
Original Pull Request Body
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.