summaryrefslogtreecommitdiff
path: root/usr.bin/whois
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-11-19 03:57:15 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-11-19 03:57:15 +0000
commit81f2811704800932cbd87da1a21c8cf592c763cf (patch)
treebbeace87ce0ac509a6122ed1ca452767c823a011 /usr.bin/whois
parent27ef1bbedfc7b4bdb58ec0f6422f4c94e0d80b33 (diff)
When eearching for the string: No match for "FOO".
verify that the length of the quoted string == length of the name we are looking up. Inspired but not based on a FreeBSD change.
Diffstat (limited to 'usr.bin/whois')
-rw-r--r--usr.bin/whois/whois.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/whois/whois.c b/usr.bin/whois/whois.c
index 870e8e6120b..99eca23ebac 100644
--- a/usr.bin/whois/whois.c
+++ b/usr.bin/whois/whois.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: whois.c,v 1.9 1999/11/19 03:50:49 millert Exp $ */
+/* $OpenBSD: whois.c,v 1.10 1999/11/19 03:57:14 millert Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)whois.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: whois.c,v 1.9 1999/11/19 03:50:49 millert Exp $";
+static char rcsid[] = "$OpenBSD: whois.c,v 1.10 1999/11/19 03:57:14 millert Exp $";
#endif
#endif /* not lint */
@@ -250,7 +250,7 @@ whois(name, sinp, flags)
if ((flags & WHOIS_INIC_FALLBACK) && !nhost && !nomatch &&
(p = strstr(buf, "No match for \""))) {
p += sizeof("No match for \"") - 1;
- if ((len = strcspn(p, "\"")) &&
+ if ((len = strcspn(p, "\"")) && len == strlen(name) &&
strncasecmp(name, p, len) == 0)
nomatch = 1;
}