diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-08-15 16:50:20 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-08-15 16:50:20 +0000 |
commit | 0cc70fcf82fefca2d186af4de0b6625a62dd31a0 (patch) | |
tree | 4dc645922acf5cffe0a6d7dd8097528c8a8ea946 /resolv/nss_dns/dns-host.c | |
parent | f4b8246c52db6b75dc871ef2f87f41e1bef1f7db (diff) | |
download | glibc-0cc70fcf82fefca2d186af4de0b6625a62dd31a0.tar.gz glibc-0cc70fcf82fefca2d186af4de0b6625a62dd31a0.tar.xz glibc-0cc70fcf82fefca2d186af4de0b6625a62dd31a0.zip |
Update.
1999-08-10 H.J. Lu <hjl@gnu.org> * resolv/nss_dns/dns-host.c (getanswer_r): Cleanup out-of- buffer handling. 1999-08-15 Ulrich Drepper <drepper@cygnus.com> * elf/elf.h: Define ElfXX_Versym. * elf/link.h (struct link_map): Use ElfXX_Versym for l_versyms definition. * stdio-common/vfprintf.c (process_string_arg): Handle precisions for string output correctly in the wide character case. Patch by Akira YOSHIYAMA <yosshy@tkf.att.ne.jp>. * intl/locale.alias: Add catalan. 1999-08-14 Andreas Jaeger <aj@arthur.rhein-neckar.de> * manual/install.texi (Configuring and compiling): Mention CFLAGS. 1999-08-15 Ulrich Drepper <drepper@cygnus.com> * po/pt_BR.po: New file. 1999-08-13 Andreas Jaeger <aj@arthur.rhein-neckar.de> * math/libm-test.c (yn_test): Adjust deltas for i386. (ccosh_test): Likewise. (jn_test): Likewise. 1999-08-15 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/_G_config.h: Get definition of mbstate_t.
Diffstat (limited to 'resolv/nss_dns/dns-host.c')
-rw-r--r-- | resolv/nss_dns/dns-host.c | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/resolv/nss_dns/dns-host.c b/resolv/nss_dns/dns-host.c index 1df7c23beb..fc00fe7796 100644 --- a/resolv/nss_dns/dns-host.c +++ b/resolv/nss_dns/dns-host.c @@ -143,7 +143,7 @@ _nss_dns_gethostbyname2_r (const char *name, int af, struct hostent *result, type = T_AAAA; break; default: - *h_errnop = NETDB_INTERNAL; + *h_errnop = NO_DATA; *errnop = EAFNOSUPPORT; return NSS_STATUS_UNAVAIL; } @@ -191,6 +191,14 @@ _nss_dns_gethostbyname_r (const char *name, struct hostent *result, enum nss_status +_nss_dns_getipnodebyname (const char *name, int af, struct hostent *result, + char *buffer, size_t buflen, int *errnop, + int *h_errnop) +{ +} + + +enum nss_status _nss_dns_gethostbyaddr_r (const char *addr, size_t len, int af, struct hostent *result, char *buffer, size_t buflen, int *errnop, int *h_errnop) @@ -419,11 +427,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) { if (errno == EMSGSIZE) - { - *errnop = ERANGE; - *h_errnop = NETDB_INTERNAL; - return NSS_STATUS_TRYAGAIN; - } + goto too_small; n = -1; } @@ -470,7 +474,9 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, linebuflen -= n; /* Get canonical name. */ n = strlen (tbuf) + 1; /* For the \0. */ - if ((size_t) n > buflen || n >= MAXHOSTNAMELEN) + if (n > linebuflen) + goto too_small; + if (n >= MAXHOSTNAMELEN) { ++had_error; continue; @@ -492,7 +498,9 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, cp += n; /* Get canonical name. */ n = strlen (tbuf) + 1; /* For the \0. */ - if ((size_t) n > buflen || n >= MAXHOSTNAMELEN) + if (n > linebuflen) + goto too_small; + if (n >= MAXHOSTNAMELEN) { ++had_error; continue; @@ -536,11 +544,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, if (n != -1 && __ns_name_ntop (packtmp, bp, linebuflen) == -1) { if (errno == EMSGSIZE) - { - *errnop = ERANGE; - *h_errnop = NETDB_INTERNAL; - return NSS_STATUS_TRYAGAIN; - } + goto too_small; n = -1; } @@ -613,11 +617,8 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, linebuflen -= sizeof (align) - ((u_long) bp % sizeof (align)); bp += sizeof (align) - ((u_long) bp % sizeof (align)); - if (n >= linebuflen) - { - ++had_error; - continue; - } + if (n > linebuflen) + goto too_small; if (hap >= &host_data->h_addr_ptrs[MAX_NR_ADDRS-1]) { cp += n; @@ -652,11 +653,7 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype, { n = strlen (qname) + 1; /* For the \0. */ if (n > linebuflen) - { - *errnop = ERANGE; - *h_errnop = NETDB_INTERNAL; - return NSS_STATUS_TRYAGAIN; - } + goto too_small; if (n >= MAXHOSTNAMELEN) goto no_recovery; result->h_name = bp; |