From ea356bff532d9ca6ae96c0916a3dedfcb8870627 Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 13 Jun 1997 19:21:54 +0000 Subject: Add MAXHOSTNAMELEN check Obtained from: OpenBSD --- lib/libc/net/res_comp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c index ffacb84..14a4ba8 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 @@ -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 -- cgit v1.1