From 5465c6b454c930b0f3efbfa9ff7d1efec52b9a30 Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 20 Nov 1995 09:34:33 +0000 Subject: [PATCH] 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(+) 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)); -- 2.20.1