aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-09-02 02:50:35 +0000
committerNeal Norwitz <nnorwitz@gmail.com>2006-09-02 02:50:35 +0000
commit6aefa916a96f7d3ce7f634134dba6060c68b647a (patch)
tree89ae9199888bdc2ae9828590310a695b8b99d58d /Modules/_cursesmodule.c
parentSF #1547931, fix typo (missing and). Will backport to 2.5 (diff)
downloadcpython-6aefa916a96f7d3ce7f634134dba6060c68b647a.tar.gz
cpython-6aefa916a96f7d3ce7f634134dba6060c68b647a.tar.bz2
cpython-6aefa916a96f7d3ce7f634134dba6060c68b647a.zip
Bug #1548092: fix curses.tparm seg fault on invalid input. Needs backport to 2.5.1 and earlier.
Diffstat (limited to 'Modules/_cursesmodule.c')
-rw-r--r--Modules/_cursesmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 2921d53a8f5..aeb1ef5f22e 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -2334,6 +2334,10 @@ PyCurses_tparm(PyObject *self, PyObject *args)
}
result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8,i9);
+ if (!result) {
+ PyErr_SetString(PyCursesError, "tparm() returned NULL");
+ return NULL;
+ }
return PyString_FromString(result);
}