summaryrefslogtreecommitdiff
path: root/lib/libc/db
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-15 23:44:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-02-15 23:44:32 +0000
commitf11245f4748e1a14cac97f14e0ef28eb18aff5dd (patch)
tree5729f75709ec2acbb7edb274d6e9f71beaed6767 /lib/libc/db
parentd5eda4dec1f6b03f5fd5e5d2aff7a5cf95d040bf (diff)
buf oflow, danny@freebsd.org
Diffstat (limited to 'lib/libc/db')
-rw-r--r--lib/libc/db/hash/ndbm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/db/hash/ndbm.c b/lib/libc/db/hash/ndbm.c
index 4ac67b56df9..3d68ba0fec4 100644
--- a/lib/libc/db/hash/ndbm.c
+++ b/lib/libc/db/hash/ndbm.c
@@ -35,7 +35,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: ndbm.c,v 1.3 1996/08/19 08:20:42 tholo Exp $";
+static char rcsid[] = "$OpenBSD: ndbm.c,v 1.4 1997/02/15 23:44:31 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -64,6 +64,10 @@ dbm_open(file, flags, mode)
HASHINFO info;
char path[MAXPATHLEN];
+ if (strlen(file) + strlen(DBM_SUFFIX) > sizeof(path)-1) {
+ errno = ENAMETOOLONG;
+ return (NULL);
+ }
info.bsize = 4096;
info.ffactor = 40;
info.nelem = 1;