aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/net
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1997-06-13 19:21:54 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1997-06-13 19:21:54 +0000
commita14d48e67ba4d01fc9d9804f3ab3bc3ad94acab5 (patch)
treeba8cbdd3b0a6b144e0e5eafafb4b48d143dcc94d /lib/libc/net
parent7887f03216b27404ac9343b865a7cf1bd0e7b80c (diff)
downloadsrc-a14d48e67ba4d01fc9d9804f3ab3bc3ad94acab5.tar.gz
src-a14d48e67ba4d01fc9d9804f3ab3bc3ad94acab5.zip
Add MAXHOSTNAMELEN check
Obtained from: OpenBSD
Notes
Notes: svn path=/head/; revision=26616
Diffstat (limited to 'lib/libc/net')
-rw-r--r--lib/libc/net/res_comp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c
index ffacb84b4bc3..14a4ba805f76 100644
--- a/lib/libc/net/res_comp.c
+++ b/lib/libc/net/res_comp.c
@@ -56,7 +56,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
static char orig_rcsid[] = "From: Id: res_comp.c,v 8.11 1996/12/02 09:17:22 vixie Exp";
-static char rcsid[] = "$Id$";
+static char rcsid[] = "$Id: res_comp.c,v 1.10 1997/02/22 15:00:29 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -95,6 +95,8 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
dn = exp_dn;
cp = comp_dn;
+ if (length > MAXHOSTNAMELEN-1)
+ length = MAXHOSTNAMELEN-1;
eom = exp_dn + length;
/*
* fetch next label in domain name