summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-08-04 10:50:21 +0000
committerkris <kris@FreeBSD.org>2000-08-04 10:50:21 +0000
commit6e733bdce9b2b694e05a6330fe81362dabc91c4c (patch)
treefe9f336cdcf65076b6e18a9a8ff784836dd95405 /lib
parentefb065997b3e1848255610e4c1684ec741c07acc (diff)
downloadFreeBSD-src-6e733bdce9b2b694e05a6330fe81362dabc91c4c.zip
FreeBSD-src-6e733bdce9b2b694e05a6330fe81362dabc91c4c.tar.gz
Prevent TMPDIR overflow.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/db/test/dbtest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/db/test/dbtest.c b/lib/libc/db/test/dbtest.c
index 4341b4c..ebf6be8 100644
--- a/lib/libc/db/test/dbtest.c
+++ b/lib/libc/db/test/dbtest.c
@@ -38,7 +38,11 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)dbtest.c 8.17 (Berkeley) 9/1/94";
+#endif
+static const char rcsid[] =
+ "$FreeBSD$";
#endif /* not lint */
#include <sys/param.h>
@@ -154,7 +158,7 @@ main(argc, argv)
p = getenv("TMPDIR");
if (p == NULL)
p = "/var/tmp";
- (void)sprintf(buf, "%s/__dbtest", p);
+ (void)snprintf(buf, sizeof(buf), "%s/__dbtest", p);
fname = buf;
(void)unlink(buf);
} else if (!sflag)
OpenPOWER on IntegriCloud