Mercurial > cpython-lru_cache-weakref
diff Modules/selectmodule.c @ 80164:02a5322b0cee 2.7
Issue #16230: Fix a crash in select.select() when one the lists changes size while iterated on.
Patch by Serhiy Storchaka.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Thu, 01 Nov 2012 20:13:54 +0100 |
| parents | ff6adb867f40 |
| children | d544873d62e9 |
line wrap: on
line diff
--- a/Modules/selectmodule.c Thu Nov 01 20:07:40 2012 +0100 +++ b/Modules/selectmodule.c Thu Nov 01 20:13:54 2012 +0100 @@ -87,7 +87,6 @@ int i; int max = -1; int index = 0; - int len = -1; PyObject* fast_seq = NULL; PyObject* o = NULL; @@ -98,9 +97,7 @@ 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 */
