This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: curses module segfaults on invalid tparm arguments
Type: Stage:
Components: Extension Modules Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: marienz, nnorwitz
Priority: normal Keywords:

Created on 2006-08-28 17:47 by marienz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (4)
msg29690 - (view) Author: Marien Zwart (marienz) * Date: 2006-08-28 17:47
At least on my platform the ncurses "tparm" function
returns NULL on certain invalid arguments.
PyCurses_tparm does not check the return value, it just
passes it to PyString_FromString. This means:

python -c "import curses;curses.setupterm();print
curses.tparm('', curses.COLOR_GREEN)"

gives me:

zsh: segmentation fault  python -c

(tested with python 2.4.3)

I am not sure what the best fix is. An exception would
make sense to me, but the (related) tigetstr function
returns None to python if the wrapped c function
returns NULL, and I have not used the curses module
enough to know what is more common.
msg29691 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-09-02 02:25
Logged In: YES 
user_id=33168

reproduced with 2.5
msg29692 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-09-02 02:51
Logged In: YES 
user_id=33168

Thanks!

Committed revision 51683. 2.6
Needs to be backported to 2.5.1 and earlier.
msg29693 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-10-28 22:05
Logged In: YES 
user_id=33168

2.5.1 - r51723
this wasn't backported to 2.4.4.  there are not more 2.4.x
releases planned.
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43904
2006-08-28 17:47:50marienzcreate