summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-20 09:34:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1995-11-20 09:34:34 +0000
commitd57e717db9235440a1e1e5b1d8d9f25080202b81 (patch)
tree633c7d824272fb47cf5ade0f53c0bc9f0d546bb2 /lib
parent4ee48263d5e0fe1b52ecacb80f540f4c9bf79217 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/gethostnamadr.c2
1 files changed, 2 insertions, 0 deletions
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));