summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-08 17:46:55 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-08 17:46:55 (GMT)
commitdea76376cb8fc2c255438e9708f492a25a5f2759 (patch)
tree0c89f86a7b8b5f1ab1172194ef66e6adb7bd2e66 /Modules
parent1ce738e08f147beb724f22a9411724a955cd418d (diff)
parente3f1b0911e02f5108b90b9b25417a448a423da40 (diff)
downloadcpython-dea76376cb8fc2c255438e9708f492a25a5f2759.zip
cpython-dea76376cb8fc2c255438e9708f492a25a5f2759.tar.gz
cpython-dea76376cb8fc2c255438e9708f492a25a5f2759.tar.bz2
Issue #23815: Fixed crashes related to directly created instances of types in
_tkinter and curses.panel modules.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_curses_panel.c7
-rw-r--r--Modules/_tkinter.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index 26bf094..bd31326 100644
--- a/Modules/_curses_panel.c
+++ b/Modules/_curses_panel.c
@@ -506,10 +506,11 @@ PyInit__curses_panel(void)
d = PyModule_GetDict(m);
/* Initialize object type */
- _curses_panelstate(m)->PyCursesPanel_Type = \
- PyType_FromSpec(&PyCursesPanel_Type_spec);
- if (_curses_panelstate(m)->PyCursesPanel_Type == NULL)
+ v = PyType_FromSpec(&PyCursesPanel_Type_spec);
+ if (v == NULL)
goto fail;
+ ((PyTypeObject *)v)->tp_new = NULL;
+ _curses_panelstate(m)->PyCursesPanel_Type = v;
import_curses();
if (PyErr_Occurred())
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index a4f0042..c4e6b95 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -3544,6 +3544,7 @@ PyInit__tkinter(void)
Py_DECREF(m);
return NULL;
}
+ ((PyTypeObject *)o)->tp_new = NULL;
if (PyModule_AddObject(m, "TkappType", o)) {
Py_DECREF(o);
Py_DECREF(m);
@@ -3556,6 +3557,7 @@ PyInit__tkinter(void)
Py_DECREF(m);
return NULL;
}
+ ((PyTypeObject *)o)->tp_new = NULL;
if (PyModule_AddObject(m, "TkttType", o)) {
Py_DECREF(o);
Py_DECREF(m);
@@ -3568,6 +3570,7 @@ PyInit__tkinter(void)
Py_DECREF(m);
return NULL;
}
+ ((PyTypeObject *)o)->tp_new = NULL;
if (PyModule_AddObject(m, "Tcl_Obj", o)) {
Py_DECREF(o);
Py_DECREF(m);