diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2000-08-04 10:50:21 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2000-08-04 10:50:21 +0000 |
commit | 099d88322514565001c5800c136440afa8278f77 (patch) | |
tree | 748603779cf98a24bf892929ba057ac19f1b3340 | |
parent | 769ec4a81a06cc41b15f944c7f5b494aaa8ba2c3 (diff) | |
download | src-099d88322514565001c5800c136440afa8278f77.tar.gz src-099d88322514565001c5800c136440afa8278f77.zip |
Prevent TMPDIR overflow.
Notes
Notes:
svn path=/head/; revision=64239
-rw-r--r-- | lib/libc/db/test/dbtest.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/db/test/dbtest.c b/lib/libc/db/test/dbtest.c index 4341b4c4709c..ebf6be883be4 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) |