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
40c9565b
Kaydet (Commit)
40c9565b
authored
Mar 08, 2012
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14211: Oops, I removed the wrong file :-)
üst
2d01dc00
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
38 deletions
+29
-38
borrowed_ref_1.py
Lib/test/crashers/borrowed_ref_1.py
+29
-0
borrowed_ref_2.py
Lib/test/crashers/borrowed_ref_2.py
+0
-38
No files found.
Lib/test/crashers/borrowed_ref_1.py
0 → 100644
Dosyayı görüntüle @
40c9565b
"""
_PyType_Lookup() returns a borrowed reference.
This attacks the call in dictobject.c.
"""
class
A
(
object
):
pass
class
B
(
object
):
def
__del__
(
self
):
print
(
'hi'
)
del
D
.
__missing__
class
D
(
dict
):
class
__missing__
:
def
__init__
(
self
,
*
args
):
pass
d
=
D
()
a
=
A
()
a
.
cycle
=
a
a
.
other
=
B
()
del
a
prev
=
None
while
1
:
d
[
5
]
prev
=
(
prev
,)
Lib/test/crashers/borrowed_ref_2.py
deleted
100644 → 0
Dosyayı görüntüle @
2d01dc00
"""
_PyType_Lookup() returns a borrowed reference.
This attacks PyObject_GenericSetAttr().
NB. on my machine this crashes in 2.5 debug but not release.
"""
class
A
(
object
):
pass
class
B
(
object
):
def
__del__
(
self
):
print
(
"hi"
)
del
C
.
d
class
D
(
object
):
def
__set__
(
self
,
obj
,
value
):
self
.
hello
=
42
class
C
(
object
):
d
=
D
()
def
g
():
pass
c
=
C
()
a
=
A
()
a
.
cycle
=
a
a
.
other
=
B
()
lst
=
[
None
]
*
1000000
i
=
0
del
a
while
1
:
c
.
d
=
42
# segfaults in PyMethod_New(__func__=D.__set__, __self__=d)
lst
[
i
]
=
c
.
g
# consume the free list of instancemethod objects
i
+=
1
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