Module Name: src Committed By: christos Date: Sun Dec 22 02:40:48 UTC 2013
Modified Files: src/lib/libc/net: getaddrinfo.c Log Message: this is supposed to be re-entrant, call don't call __hostalias that uses a static buffer. To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/lib/libc/net/getaddrinfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/net/getaddrinfo.c diff -u src/lib/libc/net/getaddrinfo.c:1.105 src/lib/libc/net/getaddrinfo.c:1.106 --- src/lib/libc/net/getaddrinfo.c:1.105 Mon May 13 13:54:55 2013 +++ src/lib/libc/net/getaddrinfo.c Sat Dec 21 21:40:48 2013 @@ -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 @@ res_searchN(const char *name, struct res 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 @@ res_searchN(const char *name, struct res /* * 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; }