cpython: d06bf822585c (original) (raw)
--- a/Misc/NEWS +++ b/Misc/NEWS @@ -113,6 +113,8 @@ Core and Builtins Library ------- +- Issue #28549: Fixed segfault in curses's addch() with ncurses6. +
- Issue #28449: tarfile.open() with mode "r" or "r:" now tries to open a tar file with compression before trying to open it without compression. Otherwise it had 50% chance failed with ignore_zeros=True.
--- a/Modules/_cursesmodule.c +++ b/Modules/_cursesmodule.c @@ -280,7 +280,7 @@ static int PyCurses_ConvertToCchar_t(PyCursesWindowObject *win, PyObject *obj, chtype *ch #ifdef HAVE_NCURSESW
, cchar_t *wch[](#l2.7)
, wchar_t *wch[](#l2.8)
#endif ) { @@ -298,8 +298,7 @@ PyCurses_ConvertToCchar_t(PyCursesWindow PyUnicode_GET_LENGTH(obj)); return 0; }
memset(wch->chars, 0, sizeof(wch->chars));[](#l2.16)
wch->chars[0] = buffer[0];[](#l2.17)
*wch = buffer[0];[](#l2.18) return 2;[](#l2.19)
#else return PyCurses_ConvertToChtype(win, obj, ch); @@ -597,7 +596,8 @@ curses_window_addch_impl(PyCursesWindowO int type; chtype cch; #ifdef HAVE_NCURSESW
#endif const char *funcname; @@ -605,14 +605,15 @@ curses_window_addch_impl(PyCursesWindowO attr = A_NORMAL; #ifdef HAVE_NCURSESW
wch.attr = attr;[](#l2.40)
wstr[1] = L'\0';[](#l2.41)
setcchar(&wcval, wstr, attr, 0, NULL);[](#l2.42) if (coordinates_group)[](#l2.43)
rtn = mvwadd_wch(cwself->win,y,x, &wch);[](#l2.44)
rtn = mvwadd_wch(cwself->win,y,x, &wcval);[](#l2.45) else {[](#l2.46)
rtn = wadd_wch(cwself->win, &wch);[](#l2.47)