summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-08-16 04:43:57 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-08-16 04:43:57 (GMT)
commitb1c6bdc76a1ac7bc40850f75dbc2dff0b361ee3d (patch)
treebae0a3720e162ed790cccc6aada33923990cc908 /Modules
parentaa9560c6331c136cbe1e9676a2c48a1e0080a32a (diff)
parent432ea4ff375f920fa4a469d34e5dad56fb33f915 (diff)
downloadcpython-b1c6bdc76a1ac7bc40850f75dbc2dff0b361ee3d.zip
cpython-b1c6bdc76a1ac7bc40850f75dbc2dff0b361ee3d.tar.gz
cpython-b1c6bdc76a1ac7bc40850f75dbc2dff0b361ee3d.tar.bz2
merge 3.4
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_cursesmodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 06aa46c..960752c 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -1393,6 +1393,10 @@ PyCursesWindow_InStr(PyCursesWindowObject *self, PyObject *args)
case 1:
if (!PyArg_ParseTuple(args,"i;n", &n))
return NULL;
+ if (n < 0) {
+ PyErr_SetString(PyExc_ValueError, "'n' must be nonnegative");
+ return NULL;
+ }
rtn2 = winnstr(self->win, rtn, Py_MIN(n, 1023));
break;
case 2:
@@ -1403,6 +1407,10 @@ PyCursesWindow_InStr(PyCursesWindowObject *self, PyObject *args)
case 3:
if (!PyArg_ParseTuple(args, "iii;y,x,n", &y, &x, &n))
return NULL;
+ if (n < 0) {
+ PyErr_SetString(PyExc_ValueError, "'n' must be nonnegative");
+ return NULL;
+ }
rtn2 = mvwinnstr(self->win, y, x, rtn, Py_MIN(n,1023));
break;
default: