Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/net this is supposed to be re-entrant, call don't c...



details:   https://anonhg.NetBSD.org/src/rev/79463c8fbd9d
branches:  trunk
changeset: 325387:79463c8fbd9d
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Dec 22 02:40:48 2013 +0000

description:
this is supposed to be re-entrant, call don't call __hostalias that uses
a static buffer.

diffstat:

 lib/libc/net/getaddrinfo.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 5196c5f99a98 -r 79463c8fbd9d lib/libc/net/getaddrinfo.c
--- a/lib/libc/net/getaddrinfo.c        Sun Dec 22 02:21:51 2013 +0000
+++ b/lib/libc/net/getaddrinfo.c        Sun Dec 22 02:40:48 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: getaddrinfo.c,v 1.105 2013/05/13 17:54:55 christos Exp $       */
+/*     $NetBSD: getaddrinfo.c,v 1.106 2013/12/22 02:40:48 christos Exp $       */
 /*     $KAME: getaddrinfo.c,v 1.29 2000/08/31 17:26:57 itojun Exp $    */
 
 /*
@@ -55,7 +55,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: getaddrinfo.c,v 1.105 2013/05/13 17:54:55 christos Exp $");
+__RCSID("$NetBSD: getaddrinfo.c,v 1.106 2013/12/22 02:40:48 christos Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -2121,6 +2121,7 @@
        const char *cp, * const *domain;
        HEADER *hp;
        u_int dots;
+       char buf[MAXHOSTNAMELEN];
        int trailing_dot, ret, saved_herrno;
        int got_nodata = 0, got_servfail = 0, tried_as_is = 0;
 
@@ -2141,7 +2142,7 @@
        /*
         * if there aren't any dots, it could be a user-level alias
         */
-       if (!dots && (cp = __hostalias(name)) != NULL) {
+       if (!dots && (cp = res_hostalias(res, name, buf, sizeof(buf))) != NULL) {
                ret = res_queryN(cp, target, res);
                return ret;
        }



Home | Main Index | Thread Index | Old Index