From: deraadt Date: Sun, 27 Apr 1997 22:20:47 +0000 (+0000) Subject: handle hex-like hostnames X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=659b2d64955197e343bf95bb8c17791205fdbbc1;p=openbsd handle hex-like hostnames --- 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 @@ -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 == '.')