]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
get_nscd_addresses: Fix subscript typos [BZ #29605]
authorJörg Sonnenberger <joerg@bec.de>
Mon, 26 Sep 2022 17:59:16 +0000 (13:59 -0400)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Wed, 28 Sep 2022 16:48:47 +0000 (12:48 -0400)
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>
(cherry picked from commit c9226c03da0276593a0918eaa9a14835183343e8)

sysdeps/posix/getaddrinfo.c

index bcff909b2f3939d04b6ad33a78ae4f510504f96c..5cda9bb072434d078a7114a26c3967195b6815e4 100644 (file)
@@ -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;