mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
make _tkinter._flatten check the result of PySequence_Size for errors #3880
This commit is contained in:
parent
4a69410e9f
commit
b3619be995
2 changed files with 13 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue