1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-03 09:00:21 +00:00

Fix a minor buffer overflow.

Obtained from: BSDi by way of Keith Bostic
This commit is contained in:
Warner Losh 1997-03-23 23:17:22 +00:00
parent 92936d823f
commit d1942b2e76
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24156

View File

@ -293,9 +293,8 @@ el_source(el, fname)
if ((fp = fopen(fname, "r")) == NULL) {
if ((ptr = getenv("HOME")) == NULL)
return -1;
fname = strncpy(path, ptr, MAXPATHLEN);
(void) strncat(path, elpath, MAXPATHLEN);
path[MAXPATHLEN-1] = '\0';
(void)snprintf(path, sizeof(path), "%s%s", ptr, elpath);
fname = path;
}
}