You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
curses.tparm() crashes for capabilities that take string parameters #161571
3.14bugs and security fixes3.15bugs and security fixes3.16new features, bugs and security fixesextension-modulesC modules in the Modules dirtopic-cursestype-crashA hard crash of the interpreter, possibly with a core dump
curses.tparm() passes all its parameters as integers. But ncurses treats some parameters as char *, for the few capabilities that take strings: pfkey, pfloc, pfx, pln, pfxl, and the extended Cs and Ms of xterm. So passing an integer there crashes:
The same happens with curses.tigetstr('Cs'). There is also no way to pass a string, so these capabilities cannot be used from Python at all.
ncurses takes as strings the parameters for which %s or %l directly follows %pN, but only in the format strings of the capabilities above of the current terminal. For other format strings with such parameters it returns NULL, so a plain b'%p1%s' does not crash: tparm() raises curses.error.
NetBSD curses takes such parameters as strings in any format string, not only in those capabilities, so with it even curses.tparm(b'x%p1%sy', 1) crashes.
3.14bugs and security fixes3.15bugs and security fixes3.16new features, bugs and security fixesextension-modulesC modules in the Modules dirtopic-cursestype-crashA hard crash of the interpreter, possibly with a core dump
Activity
gh-161571: Fix a crash in curses.tparm() with string parameters (GH-1…
[3.14] gh-161571: Fix a crash in curses.tparm() with string parameters (
[3.15] gh-161571: Fix a crash in curses.tparm() with string parameters (