tgetstr stomps memory in SV/AT 2.4

Bob Thrush x210 rd at tarpit.UUCP
Mon Mar 13 10:40:21 AEST 1989


In article <2525 at splut.UUCP> jay at splut.UUCP (Jay "you ignorant splut!" Maynard) writes about core dumps when running rn compiled with System V/AT Release 2.4 .
>
>Is this really a termcap/curses bug? Or is it more esoteric? I'm pretty
>sure that it's 2.3- or 2.4-specific, since I'm running rn compiled last
>April, and it runs fine (except for the article number problem).

  Yes, tgetstr is broken in 2.4 and 2.3.1.  In <316 at tarpit.UUCP> and 
<322 at tarpit.UUCP>, I described this problem.  In summary:

"tgetstr" should be used as:
     SYNOPSIS
          char *
          tgetstr(id, area)
          char *id, **area;
However, tgetstr behaves as though area is defined as "char *area".  My
patch to rn's "term.c" merely compensates for the error in tgetstr.  (This
could be fixed better by passing the #define from the Makefile.)

Here is the patch to term.c:

------------ snip here -----------

*** term.c	Fri Nov 21 17:39:32 1986
--- term.c.uport	Sat Nov 19 23:28:06 1988
***************
*** 33,39 ****
--- 33,45 ----
  /* guarantee capability pointer != Nullch */
  /* (I believe terminfo will ignore the &tmpaddr argument.) */
  
+ #define MICROPORT_286_CURSES_BUG
+ 
+ #ifdef MICROPORT_286_CURSES_BUG
+ #define Tgetstr(key) ((tmpstr = tgetstr(key,tcarea)) ? tmpstr : nullstr)
+ #else
  #define Tgetstr(key) ((tmpstr = tgetstr(key,&tmpaddr)) ? tmpstr : nullstr)
+ #endif MICROPORT_286_CURSES_BUG
  
  #ifdef PUSHBACK
  struct keymap {

------------ and here -----------

>
>-- 
>Jay Maynard, EMT-P, K5ZC, PP-ASEL   | Never ascribe to malice that which can
>uucp:        uunet!nuchat!   (eieio)| adequately be explained by stupidity.
>    hoptoad!academ!uhnix1!splut!jay +----------------------------------------
>{killer,bellcore}!texbell!          | "Less great!" "Tastes filling!"


-- 
Bob Thrush                 UUCP: {rtmvax,ucf-cs}!tarpit!rd
Automation Intelligence,   1200 W. Colonial Drive, Orlando, Florida 32804



More information about the Comp.unix.microport mailing list