Bug with Curses

Jeff Anton anton at ucbvax.ARPA
Sat Aug 17 04:02:33 AEST 1985


In article <4966 at mit-eddie.UUCP> simsong at mit-eddie.UUCP (Simson L. Garfinkel) writes:
>I've been using Curses at a number of different cites on both VAXen and
>suns. It appears that any application linked with curses core-dumps if
>the screen is more than 80 col. wide.

	This is a curses bug that I spotted sometime ago.  The problem
relates to how windows are scanned for differences.  It seems that
curses does not bother to check when it's compairing past the end
of the window.  As a rare case, if the window space malloced is close
to the end of memory you might get a seg fault as the scanning routine
runs of the end of data space.  A kludge fix to this problem is to
place after initscr and newwin calls a 'malloc(1);'.  This will
insure that the data after the screen will cause the scan to stop
before running out of data space.  (I know there is a billion to 1 chance
this isn't true)  I think the bug is fixed in 4.3, but I will continue
defensive programming for a long while to come.
-- 
C knows no bounds.
					Jeff Anton
					U.C.Berkeley
					ucbvax!anton
					anton at berkeley.ARPA



More information about the Comp.bugs.4bsd.ucb-fixes mailing list