mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-31 12:13:10 +00:00
Replaced unsafe use of sprintf() with snprintf().
This commit is contained in:
parent
e1c3363398
commit
d2ba10a92f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66590
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user