[2426] in Athena Bugs
tcsh (all versions)
daemon@ATHENA.MIT.EDU (John Carr)
Tue Jun 20 05:56:20 1989
To: bugs@ATHENA.MIT.EDU
Date: Tue, 20 Jun 89 05:56:02 EDT
From: John Carr <jfc@ATHENA.MIT.EDU>
There is a potential NULL pointer dereference in tcsh. If the environment
variable "TERM" is not set, tcsh will not initialize its termcap entries
(leaving all pointers == NULL). Note that tcsh calls this function every
time it prints a prompt:
tcsh_exit_so()
{
if (*TC_SE) {
if (in_stand_out) {
tputs (TC_SE, 1, tcsh_putchar);
in_stand_out = 0;
}
}
}
This was caught on the DS3100, where *NULL == core dump, not 0. For a fix,
change this, and the similar functions in "tcsh.lsupp.c", to look like
tcsh_exit_so()
{
if (TC_SE && *TC_SE) {
if (in_stand_out) {
tputs (TC_SE, 1, tcsh_putchar);
in_stand_out = 0;
}
}
}
--John Carr