From d2ba10a92f0b4a9114ed14cb03d9d11709128384 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Tue, 3 Oct 2000 17:05:02 +0000 Subject: Replaced unsafe use of sprintf() with snprintf(). --- usr.bin/from/from.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/from') diff --git a/usr.bin/from/from.c b/usr.bin/from/from.c index ff3581d25e8d..a8dffbb9ba93 100644 --- a/usr.bin/from/from.c +++ b/usr.bin/from/from.c @@ -96,14 +96,14 @@ main(argc, argv) if (!file) { if (*argv) { - (void)sprintf(buf, "%s/%s", _PATH_MAILDIR, *argv); + (void)snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, *argv); file = buf; } else { if (!(file = getenv("MAIL"))) { if (!(pwd = getpwuid(getuid()))) errx(1, "no password file entry for you"); file = pwd->pw_name; - (void)sprintf(buf, + (void)snprintf(buf, sizeof(buf), "%s/%s", _PATH_MAILDIR, file); file = buf; } -- cgit v1.2.3