From d57e717db9235440a1e1e5b1d8d9f25080202b81 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 20 Nov 1995 09:34:34 +0000 Subject: gethostbyname("#.#.#.#") should fail; not return an incompletely and incorrectly initialized hostent. in particular, h_name is supposed to be `an official name', and gethostbyname() wasn't even trying to meet that requirement. --- lib/libc/net/gethostnamadr.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/libc/net') diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c index ec3f14a9002..2c0595803b7 100644 --- a/lib/libc/net/gethostnamadr.c +++ b/lib/libc/net/gethostnamadr.c @@ -270,6 +270,7 @@ gethostbyname(name) register struct hostent *hp; char lookups[MAXDNSLUS]; +#ifdef insecure /* * disallow names consisting only of digits/dots, unless * they end in a dot. @@ -301,6 +302,7 @@ gethostbyname(name) if (!isdigit(*cp) && *cp != '.') break; } +#endif if ((_res.options & RES_INIT) == 0 && res_init() == -1) return (_gethtbyname(name)); -- cgit v1.2.3