summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-01-30 02:24:39 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-01-30 02:24:39 (GMT)
commitb3619be995f9c4080dc38f2a8532bdf44503d840 (patch)
tree6af4178f32f1b9d92f15e853e1c69caa5cde22d7 /Modules
parent4a69410e9f228cd05c0ca8fe653ffcae0d874b85 (diff)
downloadcpython-b3619be995f9c4080dc38f2a8532bdf44503d840.zip
cpython-b3619be995f9c4080dc38f2a8532bdf44503d840.tar.gz
cpython-b3619be995f9c4080dc38f2a8532bdf44503d840.tar.bz2
make _tkinter._flatten check the result of PySequence_Size for errors #3880
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_tkinter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index 93e7edc..6e89f2f 100644
--- a/Modules/_tkinter.c
+++ b/Modules/_tkinter.c
@@ -2908,7 +2908,9 @@ Tkinter_Flatten(PyObject* self, PyObject* args)
return NULL;
context.maxsize = PySequence_Size(item);
- if (context.maxsize <= 0)
+ if (context.maxsize < 0)
+ return NULL;
+ if (context.maxsize == 0)
return PyTuple_New(0);
context.tuple = PyTuple_New(context.maxsize);