mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 09:02:44 +00:00
Do a bounds check on the strcpy of environment variables onto the stack.
This commit is contained in:
parent
d9d5922eec
commit
caef76e8bd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17177
@ -259,7 +259,7 @@ main(argc, argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
(void)strcpy(term, (p = getenv("TERM")) ? p : "network");
|
(void)strncpy(term, (p = getenv("TERM")) ? p : "network", sizeof(term));
|
||||||
if (ioctl(0, TIOCGETP, &ttyb) == 0) {
|
if (ioctl(0, TIOCGETP, &ttyb) == 0) {
|
||||||
(void)strcat(term, "/");
|
(void)strcat(term, "/");
|
||||||
(void)strcat(term, speeds[(int)ttyb.sg_ospeed]);
|
(void)strcat(term, speeds[(int)ttyb.sg_ospeed]);
|
||||||
|
Loading…
Reference in New Issue
Block a user