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
0690c79c
Kaydet (Commit)
0690c79c
authored
Haz 07, 2019
tarafından
Eric Wieser
Kaydeden (comit)
Stefan Krah
Haz 07, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13881)
üst
554450fb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
test_arrays.py
Lib/ctypes/test/test_arrays.py
+15
-0
_ctypes.c
Modules/_ctypes/_ctypes.c
+1
-1
No files found.
Lib/ctypes/test/test_arrays.py
Dosyayı görüntüle @
0690c79c
...
...
@@ -208,6 +208,21 @@ class ArrayTestCase(unittest.TestCase):
_type_
=
c_int
_length_
=
0
def
test_empty_element_struct
(
self
):
class
EmptyStruct
(
Structure
):
_fields_
=
[]
obj
=
(
EmptyStruct
*
2
)()
# bpo37188: Floating point exception
assert
sizeof
(
obj
)
==
0
def
test_empty_element_array
(
self
):
class
EmptyArray
(
Array
):
_type_
=
c_int
_length_
=
0
obj
=
(
EmptyArray
*
2
)()
# bpo37188: Floating point exception
assert
sizeof
(
obj
)
==
0
def
test_bpo36504_signed_int_overflow
(
self
):
# The overflow check in PyCArrayType_new() could cause signed integer
# overflow.
...
...
Modules/_ctypes/_ctypes.c
Dosyayı görüntüle @
0690c79c
...
...
@@ -1518,7 +1518,7 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
itemsize
=
itemdict
->
size
;
if
(
length
>
PY_SSIZE_T_MAX
/
itemsize
)
{
if
(
itemsize
!=
0
&&
length
>
PY_SSIZE_T_MAX
/
itemsize
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"array too large"
);
goto
error
;
...
...
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