diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-09 06:24:35 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-09 06:24:35 (GMT) |
commit | 5e3d862392acc3b6862c6393bfbca7450523717d (patch) | |
tree | 8db6622c03bd525d1d3c7a9af5cbbebd76537225 /Modules/_curses_panel.c | |
parent | e0aec6df5e9549bd9e2c54ea57b6aa65d3c25f29 (diff) | |
download | cpython-5e3d862392acc3b6862c6393bfbca7450523717d.zip cpython-5e3d862392acc3b6862c6393bfbca7450523717d.tar.gz cpython-5e3d862392acc3b6862c6393bfbca7450523717d.tar.bz2 |
Bug #1400115, Fix segfault when calling curses.panel.userptr()
without prior setting of the userptr.
Will backport.
Diffstat (limited to 'Modules/_curses_panel.c')
-rw-r--r-- | Modules/_curses_panel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c index 08c5f09..b5f30cb 100644 --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -299,6 +299,11 @@ PyCursesPanel_userptr(PyCursesPanelObject *self) PyObject *obj; PyCursesInitialised; obj = (PyObject *) panel_userptr(self->pan); + if (obj == NULL) { + PyErr_SetString(PyCursesError, "no userptr set"); + return NULL; + } + Py_INCREF(obj); return obj; } |