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
3e4e72f6
Kaydet (Commit)
3e4e72f6
authored
Kas 11, 2008
tarafından
Amaury Forgeot d'Arc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#4298: pickle.load() can segfault on invalid or truncated input.
Patch and test by Hirokazu Yamamoto.
üst
3bae65ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletion
+13
-1
pickletester.py
Lib/test/pickletester.py
+5
-0
NEWS
Misc/NEWS
+3
-1
_pickle.c
Modules/_pickle.c
+5
-0
No files found.
Lib/test/pickletester.py
Dosyayı görüntüle @
3e4e72f6
...
...
@@ -1032,6 +1032,11 @@ class AbstractPickleModuleTests(unittest.TestCase):
self
.
assertRaises
(
pickle
.
PicklingError
,
BadPickler
()
.
dump
,
0
)
self
.
assertRaises
(
pickle
.
UnpicklingError
,
BadUnpickler
()
.
load
)
def
test_bad_input
(
self
):
# Test issue4298
s
=
bytes
([
0x58
,
0
,
0
,
0
,
0x54
])
self
.
assertRaises
(
EOFError
,
pickle
.
loads
,
s
)
class
AbstractPersistentPicklerTests
(
unittest
.
TestCase
):
...
...
Misc/NEWS
Dosyayı görüntüle @
3e4e72f6
...
...
@@ -16,7 +16,9 @@ Core and Builtins
Library
-------
- Issue #4283: fix a left-over "iteritems" call in distutils.
- Issue #4298: Fix a segfault when pickle.loads is passed a ill-formed input.
- Issue #4283: Fix a left-over "iteritems" call in distutils.
Build
-----
...
...
Modules/_pickle.c
Dosyayı görüntüle @
3e4e72f6
...
...
@@ -489,6 +489,11 @@ unpickler_read(UnpicklerObject *self, char **s, Py_ssize_t n)
return
-
1
;
}
if
(
PyBytes_GET_SIZE
(
data
)
!=
n
)
{
PyErr_SetNone
(
PyExc_EOFError
);
return
-
1
;
}
Py_XDECREF
(
self
->
last_string
);
self
->
last_string
=
data
;
...
...
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