summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1996-07-11 11:57:10 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1996-07-11 11:57:10 +0000
commitf414e14aeb6a88b7a16c85e7f3723a4071732382 (patch)
tree3ff415385b9b7bb60c02e3981f7b7e7d6e21d809
parent1ed6b3f80735603f4a68cf879feb144e558097d2 (diff)
prevent buffer overrun.
-rw-r--r--usr.bin/rdist/lookup.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/rdist/lookup.c b/usr.bin/rdist/lookup.c
index 877095a8b0f..8e00670d104 100644
--- a/usr.bin/rdist/lookup.c
+++ b/usr.bin/rdist/lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lookup.c,v 1.4 1996/06/26 05:38:13 deraadt Exp $ */
+/* $OpenBSD: lookup.c,v 1.5 1996/07/11 11:57:09 mickey Exp $ */
/*
* Copyright (c) 1983 Regents of the University of California.
@@ -35,7 +35,7 @@
#ifndef lint
static char RCSid[] =
-"$OpenBSD: lookup.c,v 1.4 1996/06/26 05:38:13 deraadt Exp $";
+"$OpenBSD: lookup.c,v 1.5 1996/07/11 11:57:09 mickey Exp $";
static char sccsid[] = "@(#)lookup.c 5.1 (Berkeley) 6/6/85";
@@ -138,6 +138,8 @@ lookup(name, action, value) /* %% in name. Ignore quotas in name */
debugmsg(DM_CALL, "lookup(%s, %d, %x)", name, action, value);
+ if (strlen(name) > sizeof(ebuf)-12)
+ yyerror("name is too long");
n = 0;
for (cp = name; *cp; )
n += *cp++;