FS#64548 - [ncurses] NULL pointer dereference

Attached to Project: Arch Linux
Opened by Boohbah (Boohbah) - Sunday, 17 November 2019, 17:50 GMT
Last edited by Doug Newgard (Scimmia) - Saturday, 23 November 2019, 16:09 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The version of ncurses shipped by arch contains a NULL pointer dereference in the initscr() function.
This was reported to redhat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1576119
A patch was issued by the ncurses maintainer: ftp://ftp.invisible-island.net/ncurses/6.1/ncurses-6.1-20180414.patch.gz
Here is the changelog for the patch: https://invisible-island.net/ncurses/NEWS.html#t20180414

Additional info:
* package version(s)
[core] ncurses-6.1-6
[testing] ncurses-6.1-7

* config and/or log files etc.
* link to upstream bug report, if any
https://bugzilla.redhat.com/show_bug.cgi?id=1576119

Steps to reproduce:
$ gdb bsnake
Reading symbols from bsnake...
(gdb) break initscr
Breakpoint 1 at 0x10e0

(gdb) r
Starting program: /home/Boohbah/Sync/src/C/bsnake/bsnake

Breakpoint 1, 0x00007ffff7f26710 in initscr () from /usr/lib/libncursesw.so.6
(gdb) s
Single stepping until exit from function initscr,
which has no line number information.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ddd057 in __strchr_sse2 () from /usr/lib/libc.so.6
This task depends upon

Closed by  Doug Newgard (Scimmia)
Saturday, 23 November 2019, 16:09 GMT
Reason for closing:  Not a bug
Comment by Eli Schwartz (eschwartz) - Sunday, 17 November 2019, 17:58 GMT
The patch link (referenced in the Fedora bug) does not exist anymore, BTW.
Comment by Boohbah (Boohbah) - Sunday, 17 November 2019, 18:00 GMT
Here is a working link for the dev patches which contain the fix: https://invisible-island.net/ncurses/dev-patches.zip
Comment by Boohbah (Boohbah) - Sunday, 17 November 2019, 19:30 GMT
I made a PKGBUILD that applies the 20181020 patch.
I don't know if it's best to use this or one of the later patches at http://invisible-mirror.net/archives/ncurses/6.1/
Comment by Boohbah (Boohbah) - Monday, 18 November 2019, 02:03 GMT
My mistake. My bug is not this bug.

Loading...