From 1e4765ffa2cc484d6fa2c51e54ba927cbae67f13 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Fri, 16 Jan 2015 16:48:51 +0000 Subject: Move to the universe. review by millert, binary checking process with doug, concept with guenther --- src/lib/libc/net/getnetent.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib/libc/net/getnetent.c') 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 @@ -/* $OpenBSD: getnetent.c,v 1.14 2014/09/15 06:15:48 guenther Exp $ */ +/* $OpenBSD: getnetent.c,v 1.15 2015/01/16 16:48:51 deraadt Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -28,13 +28,13 @@ * SUCH DAMAGE. */ -#include #include #include #include #include #include #include +#include #define MAXALIASES 35 @@ -86,8 +86,8 @@ again: if ((cp = strchr(p, '#')) != NULL) *cp = '\0'; net.n_name = p; - if (strlen(net.n_name) >= MAXHOSTNAMELEN-1) - net.n_name[MAXHOSTNAMELEN-1] = '\0'; + if (strlen(net.n_name) >= HOST_NAME_MAX+1-1) + net.n_name[HOST_NAME_MAX+1-1] = '\0'; cp = strpbrk(p, " \t"); if (cp == NULL) goto again; @@ -108,8 +108,8 @@ again: } if (q < &net_aliases[MAXALIASES - 1]) { *q++ = cp; - if (strlen(cp) >= MAXHOSTNAMELEN-1) - cp[MAXHOSTNAMELEN-1] = '\0'; + if (strlen(cp) >= HOST_NAME_MAX+1-1) + cp[HOST_NAME_MAX+1-1] = '\0'; } cp = strpbrk(cp, " \t"); if (cp != NULL) -- cgit v1.2.3-55-g6feb