diff options
| author | Sebastien Tardif <sebtardif@ncf.ca> | 2026-05-28 02:56:54 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-05-29 14:25:41 +0900 |
| commit | b8cda126b4e0fbfd514b26dec4ee8a1c6849abe9 (patch) | |
| tree | 1ff3da5dad8aaef9af732c9e28bdda6ffa779d66 /t/t4013/diff.diff_initial..side | |
| parent | 67ad42147a7acc2af6074753ebd03d904476118f (diff) | |
daemon: fix IPv6 address corruption in lookup_hostname()
getaddrinfo() is called with AF_UNSPEC hints, so it may return IPv6
results. However, the code unconditionally casts ai_addr to
sockaddr_in and passes AF_INET to inet_ntop(). On IPv6-only hosts,
this reads from the wrong struct offset, producing garbage IP
addresses.
Fix this by checking ai_family and extracting the address pointer
into a local variable before calling inet_ntop() once with the
correct family. Die on unexpected address families.
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4013/diff.diff_initial..side')
0 files changed, 0 insertions, 0 deletions
