Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
787fbe9d
Kaydet (Commit)
787fbe9d
authored
Kas 01, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #16230: Fix a crash in select.select() when one the lists changes size while iterated on.
Patch by Serhiy Storchaka.
üst
53d36b69
0168d3d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
test_select.py
Lib/test/test_select.py
+10
-0
NEWS
Misc/NEWS
+3
-0
selectmodule.c
Modules/selectmodule.c
+2
-4
No files found.
Lib/test/test_select.py
Dosyayı görüntüle @
787fbe9d
...
@@ -65,6 +65,16 @@ class SelectTestCase(unittest.TestCase):
...
@@ -65,6 +65,16 @@ class SelectTestCase(unittest.TestCase):
self
.
fail
(
'Unexpected return values from select():'
,
rfd
,
wfd
,
xfd
)
self
.
fail
(
'Unexpected return values from select():'
,
rfd
,
wfd
,
xfd
)
p
.
close
()
p
.
close
()
# Issue 16230: Crash on select resized list
def
test_select_mutated
(
self
):
a
=
[]
class
F
:
def
fileno
(
self
):
del
a
[
-
1
]
return
sys
.
__stdout__
.
fileno
()
a
[:]
=
[
F
()]
*
10
self
.
assertEqual
(
select
.
select
([],
a
,
[]),
([],
a
[:
5
],
[]))
def
test_main
():
def
test_main
():
support
.
run_unittest
(
SelectTestCase
)
support
.
run_unittest
(
SelectTestCase
)
support
.
reap_children
()
support
.
reap_children
()
...
...
Misc/NEWS
Dosyayı görüntüle @
787fbe9d
...
@@ -85,6 +85,9 @@ Core and Builtins
...
@@ -85,6 +85,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #16230: Fix a crash in select.select() when one the lists changes
size while iterated on. Patch by Serhiy Storchaka.
- Issue #16228: Fix a crash in the json module where a list changes size
- Issue #16228: Fix a crash in the json module where a list changes size
while it is being encoded. Patch by Serhiy Storchaka.
while it is being encoded. Patch by Serhiy Storchaka.
...
...
Modules/selectmodule.c
Dosyayı görüntüle @
787fbe9d
...
@@ -84,7 +84,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
...
@@ -84,7 +84,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
{
{
int
max
=
-
1
;
int
max
=
-
1
;
int
index
=
0
;
int
index
=
0
;
Py_ssize_t
i
,
len
=
-
1
;
Py_ssize_t
i
;
PyObject
*
fast_seq
=
NULL
;
PyObject
*
fast_seq
=
NULL
;
PyObject
*
o
=
NULL
;
PyObject
*
o
=
NULL
;
...
@@ -95,9 +95,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
...
@@ -95,9 +95,7 @@ seq2set(PyObject *seq, fd_set *set, pylist fd2obj[FD_SETSIZE + 1])
if
(
!
fast_seq
)
if
(
!
fast_seq
)
return
-
1
;
return
-
1
;
len
=
PySequence_Fast_GET_SIZE
(
fast_seq
);
for
(
i
=
0
;
i
<
PySequence_Fast_GET_SIZE
(
fast_seq
);
i
++
)
{
for
(
i
=
0
;
i
<
len
;
i
++
)
{
SOCKET
v
;
SOCKET
v
;
/* any intervening fileno() calls could decr this refcnt */
/* any intervening fileno() calls could decr this refcnt */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment