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
2294f3ae
Kaydet (Commit)
2294f3ae
authored
Şub 12, 2017
tarafından
INADA Naoki
Kaydeden (comit)
GitHub
Şub 12, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-29438: fixed use-after-free in key sharing dict (#17)
üst
e7ffb99f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
NEWS
Misc/NEWS
+2
-0
dictobject.c
Objects/dictobject.c
+7
-3
No files found.
Misc/NEWS
Dosyayı görüntüle @
2294f3ae
...
...
@@ -10,6 +10,8 @@ What's New in Python 3.7.0 alpha 1?
Core and Builtins
-----------------
- bpo-29438: Fixed use-after-free problem in key sharing dict.
- Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0].
- Issue #29337: Fixed possible BytesWarning when compare the code objects.
...
...
Objects/dictobject.c
Dosyayı görüntüle @
2294f3ae
...
...
@@ -4352,15 +4352,19 @@ _PyObjectDict_SetItem(PyTypeObject *tp, PyObject **dictptr,
}
if
(
value
==
NULL
)
{
res
=
PyDict_DelItem
(
dict
,
key
);
if
(
cached
!=
((
PyDictObject
*
)
dict
)
->
ma_keys
)
{
// Since key sharing dict doesn't allow deletion, PyDict_DelItem()
// always converts dict to combined form.
if
((
cached
=
CACHED_KEYS
(
tp
))
!=
NULL
)
{
CACHED_KEYS
(
tp
)
=
NULL
;
DK_DECREF
(
cached
);
}
}
else
{
int
was_shared
=
cached
==
((
PyDictObject
*
)
dict
)
->
ma_keys
;
int
was_shared
=
(
cached
==
((
PyDictObject
*
)
dict
)
->
ma_keys
)
;
res
=
PyDict_SetItem
(
dict
,
key
,
value
);
if
(
was_shared
&&
cached
!=
((
PyDictObject
*
)
dict
)
->
ma_keys
)
{
if
(
was_shared
&&
(
cached
=
CACHED_KEYS
(
tp
))
!=
NULL
&&
cached
!=
((
PyDictObject
*
)
dict
)
->
ma_keys
)
{
/* PyDict_SetItem() may call dictresize and convert split table
* into combined table. In such case, convert it to split
* table again and update type's shared key only when this is
...
...
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