summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>1995-11-20 09:34:33 +0000
committerderaadt <>1995-11-20 09:34:33 +0000
commit133a3b0da517cb830600051fc4be00a4abfd620e (patch)
tree4ff830171f4eab9e053d6a04cbc5af7a7d4d6678 /src
parent8bec8362247cc1f93778ff68eab547672f3c3020 (diff)
downloadopenbsd-133a3b0da517cb830600051fc4be00a4abfd620e.tar.gz
openbsd-133a3b0da517cb830600051fc4be00a4abfd620e.tar.bz2
openbsd-133a3b0da517cb830600051fc4be00a4abfd620e.zip
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 'src')
-rw-r--r--src/lib/libc/net/gethostnamadr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c
index ec3f14a900..2c0595803b 100644
--- a/src/lib/libc/net/gethostnamadr.c
+++ b/src/lib/libc/net/gethostnamadr.c
@@ -270,6 +270,7 @@ gethostbyname(name)
270 register struct hostent *hp; 270 register struct hostent *hp;
271 char lookups[MAXDNSLUS]; 271 char lookups[MAXDNSLUS];
272 272
273#ifdef insecure
273 /* 274 /*
274 * disallow names consisting only of digits/dots, unless 275 * disallow names consisting only of digits/dots, unless
275 * they end in a dot. 276 * they end in a dot.
@@ -301,6 +302,7 @@ gethostbyname(name)
301 if (!isdigit(*cp) && *cp != '.') 302 if (!isdigit(*cp) && *cp != '.')
302 break; 303 break;
303 } 304 }
305#endif
304 306
305 if ((_res.options & RES_INIT) == 0 && res_init() == -1) 307 if ((_res.options & RES_INIT) == 0 && res_init() == -1)
306 return (_gethtbyname(name)); 308 return (_gethtbyname(name));