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:
parent
92936d823f
commit
d1942b2e76
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24156
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user