about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Sonnenberger <joerg@bec.de>2022-09-26 13:59:16 -0400
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2022-09-28 12:47:10 -0400
commitc9226c03da0276593a0918eaa9a14835183343e8 (patch)
tree83fccb1d0066093399f31fb6912037c03eb49a00
parent7de3f0a96c4e93a7cd7312296d00039604ed94f8 (diff)
downloadglibc-c9226c03da0276593a0918eaa9a14835183343e8.tar.gz
glibc-c9226c03da0276593a0918eaa9a14835183343e8.tar.xz
glibc-c9226c03da0276593a0918eaa9a14835183343e8.zip
get_nscd_addresses: Fix subscript typos [BZ #29605]
Fix the subscript on air->family, which was accidentally set to COUNT
when it should have remained as I.

Resolves: BZ #29605

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
-rw-r--r--sysdeps/posix/getaddrinfo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index bcff909b2f..5cda9bb072 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -540,11 +540,11 @@ get_nscd_addresses (const char *name, const struct addrinfo *req,
 	  at[count].addr[2] = htonl (0xffff);
 	}
       else if (req->ai_family == AF_UNSPEC
-	       || air->family[count] == req->ai_family)
+	       || air->family[i] == req->ai_family)
 	{
-	  at[count].family = air->family[count];
+	  at[count].family = air->family[i];
 	  memcpy (at[count].addr, addrs, size);
-	  if (air->family[count] == AF_INET6)
+	  if (air->family[i] == AF_INET6)
 	    res->got_ipv6 = true;
 	}
       at[count].next = at + count + 1;