diff options
Diffstat (limited to 'src/lib/libc/net/ethers.c')
-rw-r--r-- | src/lib/libc/net/ethers.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/net/ethers.c b/src/lib/libc/net/ethers.c index 07f1da3306..a89f0c217b 100644 --- a/src/lib/libc/net/ethers.c +++ b/src/lib/libc/net/ethers.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ethers.c,v 1.22 2014/09/15 06:15:48 guenther Exp $ */ | 1 | /* $OpenBSD: ethers.c,v 1.23 2015/01/16 16:48:51 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> | 4 | * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> |
@@ -27,13 +27,13 @@ | |||
27 | #include <net/if.h> | 27 | #include <net/if.h> |
28 | #include <netinet/in.h> | 28 | #include <netinet/in.h> |
29 | #include <netinet/if_ether.h> | 29 | #include <netinet/if_ether.h> |
30 | #include <sys/param.h> | ||
31 | #include <paths.h> | 30 | #include <paths.h> |
32 | #include <errno.h> | 31 | #include <errno.h> |
33 | #include <stdio.h> | 32 | #include <stdio.h> |
34 | #include <stdlib.h> | 33 | #include <stdlib.h> |
35 | #include <string.h> | 34 | #include <string.h> |
36 | #include <ctype.h> | 35 | #include <ctype.h> |
36 | #include <limits.h> | ||
37 | #ifdef YP | 37 | #ifdef YP |
38 | #include <rpcsvc/ypclnt.h> | 38 | #include <rpcsvc/ypclnt.h> |
39 | #endif | 39 | #endif |
@@ -159,7 +159,7 @@ ether_hostton(const char *hostname, struct ether_addr *e) | |||
159 | { | 159 | { |
160 | FILE *f; | 160 | FILE *f; |
161 | char buf[BUFSIZ+1], *p; | 161 | char buf[BUFSIZ+1], *p; |
162 | char try[MAXHOSTNAMELEN]; | 162 | char try[HOST_NAME_MAX+1]; |
163 | size_t len; | 163 | size_t len; |
164 | #ifdef YP | 164 | #ifdef YP |
165 | int hostlen = strlen(hostname); | 165 | int hostlen = strlen(hostname); |
@@ -223,7 +223,7 @@ ether_line(const char *line, struct ether_addr *e, char *hostname) | |||
223 | if (*p == '\0') | 223 | if (*p == '\0') |
224 | goto bad; | 224 | goto bad; |
225 | n = strcspn(p, " \t\n"); | 225 | n = strcspn(p, " \t\n"); |
226 | if (n >= MAXHOSTNAMELEN) | 226 | if (n >= HOST_NAME_MAX+1) |
227 | goto bad; | 227 | goto bad; |
228 | strlcpy(hostname, p, n + 1); | 228 | strlcpy(hostname, p, n + 1); |
229 | return (0); | 229 | return (0); |