From: deraadt Date: Mon, 20 Nov 1995 09:34:33 +0000 (+0000) Subject: gethostbyname("#.#.#.#") should fail; not return an incompletely and X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=5465c6b454c930b0f3efbfa9ff7d1efec52b9a30;p=openbsd 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. --- 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));