diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-09 06:29:16 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-09 06:29:16 +0000 |
commit | 964ab82b1ce48ef56333971fb8c95d82c2efd07d (patch) | |
tree | 564d9babbb574b667e9892072c7d69e2fa3bf514 /Modules | |
parent | 95e3ec01400f494f6a04622ab63a5322d463539c (diff) | |
download | cpython-git-964ab82b1ce48ef56333971fb8c95d82c2efd07d.tar.gz |
Backport:
Bug #1400115, Fix segfault when calling curses.panel.userptr()
without prior setting of the userptr.
Diffstat (limited to 'Modules')
-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 08c5f09ade..b5f30cb85e 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; } |