[ python-Bugs-1548092 ] curses module segfaults on invalid tparm arguments

SourceForge.net noreply at sourceforge.net
Sat Sep 2 04:51:15 CEST 2006


Bugs item #1548092, was opened at 2006-08-28 10:47
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1548092&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
>Group: Python 2.5
Status: Open
>Resolution: Later
Priority: 5
Submitted By: Marien Zwart (marienz)
Assigned to: Neal Norwitz (nnorwitz)
Summary: curses module segfaults on invalid tparm arguments

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2006-09-01 19:51

Message:
Logged In: YES 
user_id=33168

Thanks!

Committed revision 51683. 2.6
Needs to be backported to 2.5.1 and earlier.


----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2006-09-01 19:25

Message:
Logged In: YES 
user_id=33168

reproduced with 2.5

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1548092&group_id=5470


More information about the Python-bugs-list mailing list