diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libc/net/getnetent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libc/net/getnetent.c b/src/lib/libc/net/getnetent.c index 14c39f1482..7cda141fc0 100644 --- a/src/lib/libc/net/getnetent.c +++ b/src/lib/libc/net/getnetent.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: getnetent.c,v 1.14 2014/09/15 06:15:48 guenther Exp $ */ | 1 | /* $OpenBSD: getnetent.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 1983, 1993 | 3 | * Copyright (c) 1983, 1993 |
| 4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. |
| @@ -28,13 +28,13 @@ | |||
| 28 | * SUCH DAMAGE. | 28 | * SUCH DAMAGE. |
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | #include <sys/param.h> | ||
| 32 | #include <sys/socket.h> | 31 | #include <sys/socket.h> |
| 33 | #include <netinet/in.h> | 32 | #include <netinet/in.h> |
| 34 | #include <arpa/inet.h> | 33 | #include <arpa/inet.h> |
| 35 | #include <netdb.h> | 34 | #include <netdb.h> |
| 36 | #include <stdio.h> | 35 | #include <stdio.h> |
| 37 | #include <string.h> | 36 | #include <string.h> |
| 37 | #include <limits.h> | ||
| 38 | 38 | ||
| 39 | #define MAXALIASES 35 | 39 | #define MAXALIASES 35 |
| 40 | 40 | ||
| @@ -86,8 +86,8 @@ again: | |||
| 86 | if ((cp = strchr(p, '#')) != NULL) | 86 | if ((cp = strchr(p, '#')) != NULL) |
| 87 | *cp = '\0'; | 87 | *cp = '\0'; |
| 88 | net.n_name = p; | 88 | net.n_name = p; |
| 89 | if (strlen(net.n_name) >= MAXHOSTNAMELEN-1) | 89 | if (strlen(net.n_name) >= HOST_NAME_MAX+1-1) |
| 90 | net.n_name[MAXHOSTNAMELEN-1] = '\0'; | 90 | net.n_name[HOST_NAME_MAX+1-1] = '\0'; |
| 91 | cp = strpbrk(p, " \t"); | 91 | cp = strpbrk(p, " \t"); |
| 92 | if (cp == NULL) | 92 | if (cp == NULL) |
| 93 | goto again; | 93 | goto again; |
| @@ -108,8 +108,8 @@ again: | |||
| 108 | } | 108 | } |
| 109 | if (q < &net_aliases[MAXALIASES - 1]) { | 109 | if (q < &net_aliases[MAXALIASES - 1]) { |
| 110 | *q++ = cp; | 110 | *q++ = cp; |
| 111 | if (strlen(cp) >= MAXHOSTNAMELEN-1) | 111 | if (strlen(cp) >= HOST_NAME_MAX+1-1) |
| 112 | cp[MAXHOSTNAMELEN-1] = '\0'; | 112 | cp[HOST_NAME_MAX+1-1] = '\0'; |
| 113 | } | 113 | } |
| 114 | cp = strpbrk(cp, " \t"); | 114 | cp = strpbrk(cp, " \t"); |
| 115 | if (cp != NULL) | 115 | if (cp != NULL) |
