This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gethostbyname2 seg.faults with "multi on" and IPv6


Hi,

if you add a host with two IPv6 addresses to /etc/hosts and writes
"multi on" into /etc/host.conf, gethostbyname2 will return a broken
hostent struct. h_addr_list[0] will contain a invalid pointer.
This pointer contains one address of the host, not the pointer to
this address.

This happens, when we add the new address to the existing struct
in line 223 of nss/nss_files/files-hosts.c:

                  /* Now the new address.  */                                 \
                  new_h_addr_list[naddrs++] =                                 \
                    memcpy (bufferend, tmp_result_buf.h_addr,                 \
                            tmp_result_buf.h_length);                         \

Does somebody see, where the mistake is before? It seems, bufferend
does not point to the end of the buffer but instead at the start
of h_addr_list. And it happens only with IPv6, not with IPv4.

Since I don't see the place where we make a mistake before, maybe
somebody else see it.

  Thorsten

-- 
Thorsten Kukuk       http://www.suse.de/~kukuk/        kukuk@suse.de
SuSE Linux AG        Deutschherrnstr. 15-19        D-90429 Nuernberg
--------------------------------------------------------------------    
Key fingerprint = A368 676B 5E1B 3E46 CFCE  2D97 F8FD 4E23 56C6 FB4B

Attachment: msg00091/pgp00000.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]