From 099d88322514565001c5800c136440afa8278f77 Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Fri, 4 Aug 2000 10:50:21 +0000 Subject: [PATCH] Prevent TMPDIR overflow. --- lib/libc/db/test/dbtest.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/db/test/dbtest.c b/lib/libc/db/test/dbtest.c index 4341b4c4709..ebf6be883be 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 @@ -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)