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
5f79b507
Kaydet (Commit)
5f79b507
authored
Agu 25, 2018
tarafından
Alexey Izbyshev
Kaydeden (comit)
Benjamin Peterson
Agu 25, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
closes bpo-34501: PyType_FromSpecWithBases: Check spec->name before dereferencing it. (GH-8930)
Reported by Svace static analyzer.
üst
44838be9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
typeobject.c
Objects/typeobject.c
+9
-4
No files found.
Objects/typeobject.c
Dosyayı görüntüle @
5f79b507
...
...
@@ -2847,6 +2847,15 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
char
*
res_start
=
(
char
*
)
res
;
PyType_Slot
*
slot
;
if
(
res
==
NULL
)
return
NULL
;
if
(
spec
->
name
==
NULL
)
{
PyErr_SetString
(
PyExc_SystemError
,
"Type spec does not define the name field."
);
goto
fail
;
}
/* Set the type name and qualname */
s
=
strrchr
(
spec
->
name
,
'.'
);
if
(
s
==
NULL
)
...
...
@@ -2854,8 +2863,6 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
else
s
++
;
if
(
res
==
NULL
)
return
NULL
;
type
=
&
res
->
ht_type
;
/* The flags must be initialized early, before the GC traverses us */
type
->
tp_flags
=
spec
->
flags
|
Py_TPFLAGS_HEAPTYPE
;
...
...
@@ -2865,8 +2872,6 @@ PyType_FromSpecWithBases(PyType_Spec *spec, PyObject *bases)
res
->
ht_qualname
=
res
->
ht_name
;
Py_INCREF
(
res
->
ht_qualname
);
type
->
tp_name
=
spec
->
name
;
if
(
!
type
->
tp_name
)
goto
fail
;
/* Adjust for empty tuple bases */
if
(
!
bases
)
{
...
...
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