diff options
author | Ray Lai <ray@cvs.openbsd.org> | 2006-12-20 01:50:31 +0000 |
---|---|---|
committer | Ray Lai <ray@cvs.openbsd.org> | 2006-12-20 01:50:31 +0000 |
commit | 853a2a88194960c71ab32e9aea930f326c34609a (patch) | |
tree | b21316acdb0ff494c11c7a3a155e8721b996a55a /libexec/tcpd/tcpdchk | |
parent | ae1c697fbf7b1a845da0fa145f75bdeb91b75f16 (diff) |
More strlen("") fixes.
OK otto@, ``If it makes you feel better'' millert@.
Diffstat (limited to 'libexec/tcpd/tcpdchk')
-rw-r--r-- | libexec/tcpd/tcpdchk/tcpdchk.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libexec/tcpd/tcpdchk/tcpdchk.c b/libexec/tcpd/tcpdchk/tcpdchk.c index 01812c10ce1..7b14f4a3f22 100644 --- a/libexec/tcpd/tcpdchk/tcpdchk.c +++ b/libexec/tcpd/tcpdchk/tcpdchk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcpdchk.c,v 1.8 2003/06/26 07:53:27 deraadt Exp $ */ +/* $OpenBSD: tcpdchk.c,v 1.9 2006/12/20 01:50:30 ray Exp $ */ /* * tcpdchk - examine all tcpd access control rules and inetd.conf entries @@ -20,7 +20,7 @@ #if 0 static char sccsid[] = "@(#) tcpdchk.c 1.8 97/02/12 02:13:25"; #else -static char rcsid[] = "$OpenBSD: tcpdchk.c,v 1.8 2003/06/26 07:53:27 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: tcpdchk.c,v 1.9 2006/12/20 01:50:30 ray Exp $"; #endif #endif @@ -372,6 +372,8 @@ char *pat; tcpd_warn("%s: daemon name begins with \"@\"", pat); } else if (pat[0] == '.') { tcpd_warn("%s: daemon name begins with dot", pat); + } else if (pat[0] == '\0') { + tcpd_warn("%s: daemon name begins with NUL", pat); } else if (pat[strlen(pat) - 1] == '.') { tcpd_warn("%s: daemon name ends in dot", pat); } else if (STR_EQ(pat, "ALL") || STR_EQ(pat, unknown)) { @@ -404,6 +406,8 @@ char *pat; tcpd_warn("%s: user name begins with \"@\"", pat); } else if (pat[0] == '.') { tcpd_warn("%s: user name begins with dot", pat); + } else if (pat[0] == '\0') { + tcpd_warn("%s: user name begins with NUL", pat); } else if (pat[strlen(pat) - 1] == '.') { tcpd_warn("%s: user name ends in dot", pat); } else if (STR_EQ(pat, "ALL") || STR_EQ(pat, unknown) @@ -477,7 +481,9 @@ char *pat; } else if (reserved_name(pat)) { /* other reserved */ /* void */ ; } else if (NOT_INADDR(pat)) { /* internet name */ - if (pat[strlen(pat) - 1] == '.') { + if (pat[0] == '\0') { + tcpd_warn("%s: domain or host name begins with NUL", pat); + } else if (pat[strlen(pat) - 1] == '.') { tcpd_warn("%s: domain or host name ends in dot", pat); } else if (pat[0] != '.') { addr_count = check_dns(pat); @@ -487,6 +493,8 @@ char *pat; /* void */ ; } else if (pat[0] == '.') { tcpd_warn("%s: network number begins with dot", pat); + } else if (pat[0] == '\0') { + tcpd_warn("%s: network number begins with NUL", pat); } else if (pat[strlen(pat) - 1] != '.') { check_dns(pat); } |