From 0cc70fcf82fefca2d186af4de0b6625a62dd31a0 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 15 Aug 1999 16:50:20 +0000 Subject: Update. 1999-08-10 H.J. Lu * resolv/nss_dns/dns-host.c (getanswer_r): Cleanup out-of- buffer handling. 1999-08-15 Ulrich Drepper * 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 . * intl/locale.alias: Add catalan. 1999-08-14 Andreas Jaeger * manual/install.texi (Configuring and compiling): Mention CFLAGS. 1999-08-15 Ulrich Drepper * po/pt_BR.po: New file. 1999-08-13 Andreas Jaeger * math/libm-test.c (yn_test): Adjust deltas for i386. (ccosh_test): Likewise. (jn_test): Likewise. 1999-08-15 Ulrich Drepper * sysdeps/generic/_G_config.h: Get definition of mbstate_t. --- resolv/nss_dns/dns-host.c | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) (limited to 'resolv/nss_dns') 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; } @@ -190,6 +190,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, @@ -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; -- cgit v1.2.3