Bug in vanilla System V terminfo

Steve Lademann steve at miduet.mifnet.gec-mi-ate.co.uk
Thu Apr 24 21:54:12 AEST 1986


There is a 'lurker' in the terminfo supplied with vanilla System V.2
which exhibits itself by causing a process using the keypad code in
terminfo to occasionally core dump mysteriously. On editing in some
debug information, it stops core dumping.

This is due to a bad condition on a 'for' loop at line 111 (or
thereabouts).  The condition reads.

		for(i=0; SP->kp[i].keynum >= 0; i++)

which causes it to whiz off through memory looking for a key which is
numbered negatively, whereas the code marks the entry after the last
key in the array as 0.

The (obvious) cure is therefore

		for(i=0; SP->kp[i].keynum > 0; i++)


-----------------------------------------------------------------
|Steve Lademann		|Phone:	44 727 59292 x326		|
|Marconi Instruments Ltd|UUCP : ...mcvax!ukc!hrc63!miduet!steve	|
|St. Albans		|NRS  : steve at uk.co.gec-mi-ate.mifnet	|
|Herts.   UK		|					|
-----------------------------------------------------------------
|"The views expressed herein do not necessarily reflect"|	|
|"those of my employer, and may not even reflect my own"|	|
-----------------------------------------------------------------



More information about the Comp.unix.wizards mailing list