Buffer overflow from Keith Bostic.

Obtained from: BSDi by way of Keith Bostic
This commit is contained in:
imp 1997-03-24 05:51:59 +00:00
parent 2a37113faa
commit e5d10bdc2e

View File

@ -87,7 +87,7 @@ ruserpass(host, aname, apass, aacct)
hdir = getenv("HOME");
if (hdir == NULL)
hdir = ".";
(void) sprintf(buf, "%s/.netrc", hdir);
(void) snprintf(buf, sizeof(buf), "%s/.netrc", hdir);
cfile = fopen(buf, "r");
if (cfile == NULL) {
if (errno != ENOENT)