summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/res_comp.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1997-06-13 19:21:54 +0000
committerache <ache@FreeBSD.org>1997-06-13 19:21:54 +0000
commitea356bff532d9ca6ae96c0916a3dedfcb8870627 (patch)
tree4b110a755011399a15105730c7075e40a9f0c150 /lib/libc/net/res_comp.c
parentd15c79aba2767f76cc785ce52cadba7b7896a233 (diff)
downloadFreeBSD-src-ea356bff532d9ca6ae96c0916a3dedfcb8870627.zip
FreeBSD-src-ea356bff532d9ca6ae96c0916a3dedfcb8870627.tar.gz
Add MAXHOSTNAMELEN check
Obtained from: OpenBSD
Diffstat (limited to 'lib/libc/net/res_comp.c')
-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 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 <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
OpenPOWER on IntegriCloud