RESOLV: handle empty addr list properly#8773
Conversation
There was a problem hiding this comment.
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.
9e3a853 to
e69ee33
Compare
sumit-bose
left a comment
There was a problem hiding this comment.
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]>
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.