summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-06 07:55:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-07-06 07:55:59 +0000
commita66e6c132dfc5477c6359bf03ab2bd43b9779756 (patch)
treebbd09955d10bb68d31456c8d2bc8a5c3dfeb22ac
parent4ab9be160e47d8a43e9972f72dcf8ed0ef8c9490 (diff)
if we find an unprintable char, bail totally
-rw-r--r--lib/libc/net/rcmd.c5
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);
}