mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Add Bruce's improvement to security patch
This commit is contained in:
parent
4680e2ceec
commit
7f7e1b67ff
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17284
1 changed files with 6 additions and 1 deletions
|
@ -102,6 +102,7 @@ u_char escapechar = '~';
|
|||
char *speeds[] = {
|
||||
"0", "50", "75", "110", "134", "150", "200", "300", "600", "1200",
|
||||
"1800", "2400", "4800", "9600", "19200", "38400", "57600", "115200"
|
||||
#define MAX_SPEED_LENGTH (sizeof("115200") - 1)
|
||||
};
|
||||
|
||||
#ifdef OLDSUN
|
||||
|
@ -259,7 +260,11 @@ main(argc, argv)
|
|||
exit(1);
|
||||
}
|
||||
|
||||
(void)strncpy(term, (p = getenv("TERM")) ? p : "network", sizeof(term));
|
||||
#define MAX_TERM_LENGTH (sizeof(term) - 1 - MAX_SPEED_LENGTH - 1)
|
||||
|
||||
(void)strncpy(term, (p = getenv("TERM")) ? p : "network",
|
||||
MAX_TERM_LENGTH);
|
||||
term[MAX_TERM_LENGTH] = '\0';
|
||||
if (ioctl(0, TIOCGETP, &ttyb) == 0) {
|
||||
(void)strcat(term, "/");
|
||||
(void)strcat(term, speeds[(int)ttyb.sg_ospeed]);
|
||||
|
|
Loading…
Reference in a new issue