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
5877bc3d
Kaydet (Commit)
5877bc3d
authored
Eyl 22, 2002
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add recursion limit to pickling. Fixes #576084.
üst
d412a12f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
cPickle.c
Modules/cPickle.c
+9
-0
No files found.
Modules/cPickle.c
Dosyayı görüntüle @
5877bc3d
...
...
@@ -313,6 +313,7 @@ typedef struct Picklerobject {
PyObject
*
inst_pers_func
;
int
bin
;
int
fast
;
/* Fast mode doesn't save in memo, don't use if circ ref */
int
nesting
;
int
(
*
write_func
)(
struct
Picklerobject
*
,
char
*
,
int
);
char
*
write_buf
;
int
buf_size
;
...
...
@@ -1850,6 +1851,12 @@ save(Picklerobject *self, PyObject *args, int pers_save) {
*
callable
=
0
,
*
state
=
0
;
int
res
=
-
1
,
tmp
,
size
;
if
(
self
->
nesting
++
>
Py_GetRecursionLimit
()){
PyErr_SetString
(
PyExc_RuntimeError
,
"maximum recursion depth exceeded"
);
goto
finally
;
}
if
(
!
pers_save
&&
self
->
pers_func
)
{
if
((
tmp
=
save_pers
(
self
,
args
,
self
->
pers_func
))
!=
0
)
{
res
=
tmp
;
...
...
@@ -2068,6 +2075,7 @@ save(Picklerobject *self, PyObject *args, int pers_save) {
PyErr_SetObject
(
UnpickleableError
,
args
);
finally:
self
->
nesting
--
;
Py_XDECREF
(
py_ob_id
);
Py_XDECREF
(
__reduce__
);
Py_XDECREF
(
t
);
...
...
@@ -2287,6 +2295,7 @@ newPicklerobject(PyObject *file, int bin) {
self
->
write_buf
=
NULL
;
self
->
bin
=
bin
;
self
->
fast
=
0
;
self
->
nesting
=
0
;
self
->
fast_container
=
0
;
self
->
fast_memo
=
NULL
;
self
->
buf_size
=
0
;
...
...
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