diff options
Diffstat (limited to 'src/lib/libc')
| -rw-r--r-- | src/lib/libc/net/rcmd.c | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/src/lib/libc/net/rcmd.c b/src/lib/libc/net/rcmd.c index 4fbf602215..9db161e96d 100644 --- a/src/lib/libc/net/rcmd.c +++ b/src/lib/libc/net/rcmd.c | |||
| @@ -34,7 +34,7 @@ | |||
| 34 | */ | 34 | */ | 
| 35 | 35 | ||
| 36 | #if defined(LIBC_SCCS) && !defined(lint) | 36 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.26 1997/07/09 01:08:47 millert Exp $"; | 37 | static char *rcsid = "$OpenBSD: rcmd.c,v 1.27 1998/02/11 02:26:15 deraadt Exp $"; | 
| 38 | #endif /* LIBC_SCCS and not lint */ | 38 | #endif /* LIBC_SCCS and not lint */ | 
| 39 | 39 | ||
| 40 | #include <sys/param.h> | 40 | #include <sys/param.h> | 
| @@ -417,7 +417,8 @@ __ivaliduser(hostf, raddrl, luser, ruser) | |||
| 417 | /* Skip lines that are too long. */ | 417 | /* Skip lines that are too long. */ | 
| 418 | if (strchr(p, '\n') == NULL) { | 418 | if (strchr(p, '\n') == NULL) { | 
| 419 | while ((ch = getc(hostf)) != '\n' && ch != EOF) | 419 | while ((ch = getc(hostf)) != '\n' && ch != EOF) | 
| 420 | ; | 420 | if (!isprint(ch)) | 
| 421 | goto bail; | ||
| 421 | continue; | 422 | continue; | 
| 422 | } | 423 | } | 
| 423 | if (*p == '#') | 424 | if (*p == '#') | 
| @@ -434,8 +435,11 @@ __ivaliduser(hostf, raddrl, luser, ruser) | |||
| 434 | p++; | 435 | p++; | 
| 435 | user = p; | 436 | user = p; | 
| 436 | while (*p != '\n' && *p != ' ' && | 437 | while (*p != '\n' && *p != ' ' && | 
| 437 | *p != '\t' && *p != '\0') | 438 | *p != '\t' && *p != '\0') { | 
| 439 | if (!isprint(*p)) | ||
| 440 | goto bail; | ||
| 438 | p++; | 441 | p++; | 
| 442 | } | ||
| 439 | } else | 443 | } else | 
| 440 | user = p; | 444 | user = p; | 
| 441 | *p = '\0'; | 445 | *p = '\0'; | 
