bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse(). (#4220)

This commit is contained in:
Serhiy Storchaka 2017-11-01 20:48:49 +02:00 committed by GitHub
parent 7e68790f3d
commit 4f469c0966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 13 deletions

View file

@ -92,7 +92,7 @@ class TestCurses(unittest.TestCase):
with self.subTest(meth=meth.__qualname__, args=args):
meth(*args)
for meth in [stdscr.box, stdscr.clear, stdscr.clrtobot,
for meth in [stdscr.clear, stdscr.clrtobot,
stdscr.clrtoeol, stdscr.cursyncup, stdscr.delch,
stdscr.deleteln, stdscr.erase, stdscr.getbegyx,
stdscr.getbkgd, stdscr.getkey, stdscr.getmaxyx,
@ -126,6 +126,13 @@ class TestCurses(unittest.TestCase):
win.border(65, 66, 67, 68,
69, [], 71, 72)
win.box(65, 67)
win.box('!', '_')
win.box(b':', b'~')
self.assertRaises(TypeError, win.box, 65, 66, 67)
self.assertRaises(TypeError, win.box, 65)
win.box()
stdscr.clearok(1)
win4 = stdscr.derwin(2,2)