Protect from stack overrun via /etc/ttys, which could possibly allow a
root user to change the securelevel. Pointed out by Thomas H. Ptacek <tqbf@enteract.com>.
This commit is contained in:
parent
ebf34cb494
commit
d71873490f
@ -1089,7 +1089,7 @@ start_window_system(sp)
|
||||
if (sp->se_type) {
|
||||
/* Don't use malloc after fork */
|
||||
strcpy(term, "TERM=");
|
||||
strcat(term, sp->se_type);
|
||||
strncat(term, sp->se_type, sizeof(term) - 6);
|
||||
env[0] = term;
|
||||
env[1] = 0;
|
||||
}
|
||||
@ -1154,7 +1154,7 @@ start_getty(sp)
|
||||
if (sp->se_type) {
|
||||
/* Don't use malloc after fork */
|
||||
strcpy(term, "TERM=");
|
||||
strcat(term, sp->se_type);
|
||||
strncat(term, sp->se_type, sizeof(term) - 6);
|
||||
env[0] = term;
|
||||
env[1] = 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user