diff options
author | 1997-07-06 07:55:58 +0000 | |
---|---|---|
committer | 1997-07-06 07:55:58 +0000 | |
commit | 034b81d3f738d705c4e4c93567381936548b8e4e (patch) | |
tree | 9f3ec877034e25213b4c27b7c67dd63ba65b1e9b /lib/libc/net/rcmd.c | |
parent | Sync with NetBSD changes, 970415 - 970705. (diff) | |
download | wireguard-openbsd-034b81d3f738d705c4e4c93567381936548b8e4e.tar.xz wireguard-openbsd-034b81d3f738d705c4e4c93567381936548b8e4e.zip |
if we find an unprintable char, bail totally
Diffstat (limited to 'lib/libc/net/rcmd.c')
-rw-r--r-- | lib/libc/net/rcmd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/net/rcmd.c b/lib/libc/net/rcmd.c index ae746f53016..6e3ee93cafe 100644 --- a/lib/libc/net/rcmd.c +++ b/lib/libc/net/rcmd.c @@ -34,7 +34,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmd.c,v 1.24 1997/06/29 06:02:48 deraadt Exp $"; +static char *rcsid = "$OpenBSD: rcmd.c,v 1.25 1997/07/06 07:55:58 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -422,6 +422,8 @@ __ivaliduser(hostf, raddrl, luser, ruser) if (*p == '#') continue; while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') { + if (!isprint(*p)) + goto bail; *p = isupper(*p) ? tolower(*p) : *p; p++; } @@ -527,6 +529,7 @@ __ivaliduser(hostf, raddrl, luser, ruser) if (hostok >= 1 && userok >= 1) return (0); } +bail: return (-1); } |