summaryrefslogtreecommitdiff
path: root/lib/libc/net/res_comp.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-19 10:10:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-19 10:10:48 +0000
commita69a5ac6994ab8ae2fb41e30901abd9f7f51a9ac (patch)
treee4cdfc3dce4bbd1564a757c227d4bdd9ab669a68 /lib/libc/net/res_comp.c
parenta64ea691ae37f0d061f9fdc42049b95cfa7f8dca (diff)
constrain to MAXHOSTNAMELEN-1 not MAXDNAME, duh
Diffstat (limited to 'lib/libc/net/res_comp.c')
-rw-r--r--lib/libc/net/res_comp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libc/net/res_comp.c b/lib/libc/net/res_comp.c
index bcc7d16c4db..86ff7e7657e 100644
--- a/lib/libc/net/res_comp.c
+++ b/lib/libc/net/res_comp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: res_comp.c,v 1.5 1997/03/27 20:45:33 deraadt Exp $ */
+/* $OpenBSD: res_comp.c,v 1.6 1997/04/19 10:10:47 deraadt Exp $ */
/*
* ++Copyright++ 1985, 1993
@@ -60,7 +60,7 @@
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
static char rcsid[] = "$From: res_comp.c,v 8.11 1996/12/02 09:17:22 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: res_comp.c,v 1.5 1997/03/27 20:45:33 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: res_comp.c,v 1.6 1997/04/19 10:10:47 deraadt Exp $";
#endif
#endif /* LIBC_SCCS and not lint */
@@ -100,7 +100,9 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
dn = exp_dn;
cp = comp_dn;
- eom = exp_dn + (length > MAXDNAME ? MAXDNAME : length);
+ if (length > MAXHOSTNAMELEN-1)
+ length = MAXHOSTNAMELEN-1;
+ eom = exp_dn + length;
/*
* fetch next label in domain name
*/