NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/42412: atc(6) segfaults on invalid $TERM



The following reply was made to PR bin/42412; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/42412: atc(6) segfaults on invalid $TERM
Date: Sun, 6 Dec 2009 06:58:06 +0000

 On Fri, Dec 04, 2009 at 09:50:03PM +0000, dholland%eecs.harvard.edu@localhost 
wrote:
  > % env TERM=fubar /usr/games/atc
  > Segmentation fault
  > % 
 
 Starting program: /usr/obj/games/atc/atc 
 
 Program received signal SIGSEGV, Segmentation fault.
 0xbbbc5512 in t_goto (info=0x0, 
     CM=0x20203020 <Address 0x20203020 out of bounds>, destcol=0, destline=0, 
     buffer=0xbfbfea84 "\b.......|" , limit=63)
     at /usr/src/lib/libterm/tgoto.c:128
 128             while ((c = *cp++) != '\0') {
 (gdb) where
 #0  0xbbbc5512 in t_goto (info=0x0, 
     CM=0x20203020 <Address 0x20203020 out of bounds>, destcol=0, destline=0, 
     buffer=0xbfbfea84 "\b.......|", limit=63)
     at /usr/src/lib/libterm/tgoto.c:128
 #1  0xbbbb6bdc in _cursesi_setterm (type=0xbfbffea2 "fubar", screen=0xbb915000)
     at /usr/src/lib/libcurses/setterm.c:196
 #2  0xbbbb495f in newterm (type=0xbfbffea2 "fubar", outfd=0x8053b20, 
     infd=0x8053ac8) at /usr/src/lib/libcurses/screen.c:154
 #3  0xbbbae495 in initscr () at /usr/src/lib/libcurses/initscr.c:68
 #4  0x0804add9 in init_gr () at /usr/src/games/atc/graphics.c:120
 #5  0x0804f176 in main (argc=1, argv=0xbfbfec84)
     at /usr/src/games/atc/main.c:144
 (gdb) p cp
 $2 = 0x20203020 <Address 0x20203020 out of bounds>
 (gdb) 
 
 This appears to come from screen->tc_cm in the caller. It's not
 immediately clear to me what's supposed to be happening for undefined
 terminal types, but it's clearly wrong.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index