summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-27 22:20:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-27 22:20:48 +0000
commite58197bd8638f4f1cb9d8677f759b1b36df27d83 (patch)
treefd1ca034496537ffa3f7f8c757c84d7771838c96 /lib
parent40260a43d5768fe2aded055fa20ffb7de193db02 (diff)
handle hex-like hostnames
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/gethostnamadr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/net/gethostnamadr.c b/lib/libc/net/gethostnamadr.c
index 95e00484d60..ae2cd7c91fa 100644
--- a/lib/libc/net/gethostnamadr.c
+++ b/lib/libc/net/gethostnamadr.c
@@ -52,7 +52,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.22 1997/04/15 11:27:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.23 1997/04/27 22:20:47 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -521,7 +521,8 @@ gethostbyname2(name, af)
if (!isdigit(*cp) && *cp != '.')
break;
}
- if (isxdigit(name[0]) || name[0] == ':')
+ if ((isxdigit(name[0]) && strchr(name, ':') != NULL) ||
+ name[0] == ':')
for (cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.')