bug-ncurses
[Top][All Lists]
Advanced

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

Uninitialized variable in tigetnum() and friends


From: Nadav Har'El
Subject: Uninitialized variable in tigetnum() and friends
Date: Mon, 27 Oct 2014 11:04:09 +0200

Hi, I noticed in ncurses-5.9/ncurses/tinfo/lib_ti.c, in the functions tigetnum(), tigetflag() and tigetstr(), the variable "j" is not initialized.
If NCURSES_XNAMES is not defined (because --disable-tcap-names was used), then j can be used without being ever initialized. In that case it can happen to be a large random positive number and cause a crash.

I noticed this when compiling the "rogue" demo for OSv (http://osv.io) with gcc 4.9.1.

I attach a trivial patch fixing this bug.

--
Nadav Har'El
address@hidden

Attachment: ncurses.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]