[issue27666] "stack smashing detected" in PyCursesWindow_Box

STINNER Victor report at bugs.python.org
Mon Nov 6 20:03:45 EST 2017


STINNER Victor <victor.stinner at gmail.com> added the comment:

The Python 2.7 backport (commit b694770a2b23cd485c98bf673a8b2dc1a865d9df) is wrong. The _curses module cannot be compiled anymore:

Example of compilation errors:

/home/haypo/prog/python/2.7/Modules/_cursesmodule.c: In function 'PyCursesWindow_Box':
/home/haypo/prog/python/2.7/Modules/_cursesmodule.c:649:39: warning: passing argument 1 of 'PyCurses_ConvertToChtype' from incompatible pointer type [-Wincompatible-pointer-types]
         if (!PyCurses_ConvertToChtype(self, temp1, &ch1)) {
                                       ^~~~
/home/haypo/prog/python/2.7/Modules/_cursesmodule.c:195:1: note: expected 'PyObject * {aka struct _object *}' but argument is of type 'PyCursesWindowObject * {aka struct <anonymous> *}'
 PyCurses_ConvertToChtype(PyObject *obj, chtype *ch)
 ^~~~~~~~~~~~~~~~~~~~~~~~
/home/haypo/prog/python/2.7/Modules/_cursesmodule.c:649:45: warning: passing argument 2 of 'PyCurses_ConvertToChtype' from incompatible pointer type [-Wincompatible-pointer-types]
         if (!PyCurses_ConvertToChtype(self, temp1, &ch1)) {
                                             ^~~~~
/home/haypo/prog/python/2.7/Modules/_cursesmodule.c:195:1: note: expected 'chtype * {aka unsigned int *}' but argument is of type 'PyObject * {aka struct _object *}'
 PyCurses_ConvertToChtype(PyObject *obj, chtype *ch)
 ^~~~~~~~~~~~~~~~~~~~~~~~
/home/haypo/prog/python/2.7/Modules/_cursesmodule.c:649:14: error: too many arguments to function 'PyCurses_ConvertToChtype'
         if (!PyCurses_ConvertToChtype(self, temp1, &ch1)) {
              ^~~~~~~~~~~~~~~~~~~~~~~~
/home/haypo/prog/python/2.7/Modules/_cursesmodule.c:195:1: note: declared here
 PyCurses_ConvertToChtype(PyObject *obj, chtype *ch)
 ^~~~~~~~~~~~~~~~~~~~~~~~

----------
nosy: +haypo
resolution: fixed -> 
status: closed -> open

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27666>
_______________________________________


More information about the Python-bugs-list mailing list