#6243: fix segfault when keyname() returns a NULL pointer.

Bug noted by Trundle, patched by Trundle and Jerry Chen.
This commit is contained in:
Andrew M. Kuchling 2009-09-25 22:23:54 +00:00
parent a9a7611fb6
commit b49e53ee16
2 changed files with 12 additions and 4 deletions

View file

@ -257,6 +257,10 @@ def test_resize_term(stdscr):
if curses.LINES != lines - 1 or curses.COLS != cols + 1:
raise RuntimeError, "Expected resizeterm to update LINES and COLS"
def test_issue6243(stdscr):
curses.ungetch(1025)
stdscr.getkey()
def main(stdscr):
curses.savetty()
try:
@ -264,6 +268,7 @@ def main(stdscr):
window_funcs(stdscr)
test_userptr_without_set(stdscr)
test_resize_term(stdscr)
test_issue6243(stdscr)
finally:
curses.resetty()