mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #16230: Fix a crash in select.select() when one the lists changes size while iterated on.
Patch by Serhiy Storchaka.
This commit is contained in:
commit
0168d3d9b1
3 changed files with 15 additions and 4 deletions
|
@ -89,7 +89,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
|
|||
{
|
||||
int max = -1;
|
||||
int index = 0;
|
||||
Py_ssize_t i, len = -1;
|
||||
Py_ssize_t i;
|
||||
PyObject* fast_seq = NULL;
|
||||
PyObject* o = NULL;
|
||||
|
||||
|
@ -100,9 +100,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
|
|||
if (!fast_seq)
|
||||
return -1;
|
||||
|
||||
len = PySequence_Fast_GET_SIZE(fast_seq);
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
for (i = 0; i < PySequence_Fast_GET_SIZE(fast_seq); i++) {
|
||||
SOCKET v;
|
||||
|
||||
/* any intervening fileno() calls could decr this refcnt */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue