From 659b2d64955197e343bf95bb8c17791205fdbbc1 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sun, 27 Apr 1997 22:20:47 +0000 Subject: [PATCH] handle hex-like hostnames --- lib/libc/net/gethostnamadr.c | 5 +++-- 1 file 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 @@ -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 == '.') -- 2.20.1