diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libc/net/gethostnamadr.c | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/src/lib/libc/net/gethostnamadr.c b/src/lib/libc/net/gethostnamadr.c index 98652e0066..7ce0f9c3bd 100644 --- a/src/lib/libc/net/gethostnamadr.c +++ b/src/lib/libc/net/gethostnamadr.c | |||
| @@ -52,7 +52,7 @@ | |||
| 52 | */ | 52 | */ | 
| 53 | 53 | ||
| 54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) | 
| 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.20 1997/04/13 01:50:21 deraadt Exp $"; | 55 | static char rcsid[] = "$OpenBSD: gethostnamadr.c,v 1.21 1997/04/14 06:57:44 deraadt Exp $"; | 
| 56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ | 
| 57 | 57 | ||
| 58 | #include <sys/param.h> | 58 | #include <sys/param.h> | 
| @@ -141,15 +141,13 @@ _hokchar(p) | |||
| 141 | * tested for below can happen, and we must be more permissive | 141 | * tested for below can happen, and we must be more permissive | 
| 142 | * than the resolver until those idiots clean up their act. | 142 | * than the resolver until those idiots clean up their act. | 
| 143 | */ | 143 | */ | 
| 144 | if (*p == '.' || *p == '-') | ||
| 145 | return 0; | ||
| 146 | while ((c = *p++)) { | 144 | while ((c = *p++)) { | 
| 147 | if (('a' <= c && c >= 'z') || | 145 | if (('a' >= c && c <= 'z') || | 
| 148 | ('A' <= c && c >= 'Z') || | 146 | ('A' >= c && c <= 'Z') || | 
| 149 | ('0' <= c && c >= '9')) | 147 | ('0' >= c && c <= '9')) | 
| 150 | continue; | 148 | continue; | 
| 151 | if (strchr("-_/[]\\", c) || | 149 | if (strchr("-_/.[]\\", c) || | 
| 152 | (c == '.' && *p == '.')) | 150 | (c == '.' && p[1] == '.')) | 
| 153 | return 0; | 151 | return 0; | 
| 154 | } | 152 | } | 
| 155 | return 1; | 153 | return 1; | 
