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
4cfb42dd
Kaydet (Commit)
4cfb42dd
authored
Agu 30, 2011
tarafından
Amaury Forgeot d'Arc
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
üst
97d67924
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
test_buffers.py
Lib/ctypes/test/test_buffers.py
+4
-0
NEWS
Misc/NEWS
+3
-0
_ctypes.c
Modules/_ctypes/_ctypes.c
+4
-2
No files found.
Lib/ctypes/test/test_buffers.py
Dosyayı görüntüle @
4cfb42dd
...
...
@@ -20,6 +20,10 @@ class StringBufferTestCase(unittest.TestCase):
self
.
assertEqual
(
b
[::
2
],
b
"ac"
)
self
.
assertEqual
(
b
[::
5
],
b
"a"
)
def
test_buffer_interface
(
self
):
self
.
assertEqual
(
len
(
bytearray
(
create_string_buffer
(
0
))),
0
)
self
.
assertEqual
(
len
(
bytearray
(
create_string_buffer
(
1
))),
1
)
try
:
c_wchar
except
NameError
:
...
...
Misc/NEWS
Dosyayı görüntüle @
4cfb42dd
...
...
@@ -152,6 +152,9 @@ Library
Extension Modules
-----------------
- Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
- Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
signature. Without this, architectures where sizeof void* != sizeof int are
broken. Patch given by Hallvard B Furuseth.
...
...
Modules/_ctypes/_ctypes.c
Dosyayı görüntüle @
4cfb42dd
...
...
@@ -2488,8 +2488,10 @@ static int PyCData_NewGetBuffer(PyObject *_self, Py_buffer *view, int flags)
view
->
ndim
=
dict
->
ndim
;
view
->
shape
=
dict
->
shape
;
view
->
itemsize
=
self
->
b_size
;
for
(
i
=
0
;
i
<
view
->
ndim
;
++
i
)
{
view
->
itemsize
/=
dict
->
shape
[
i
];
if
(
view
->
itemsize
)
{
for
(
i
=
0
;
i
<
view
->
ndim
;
++
i
)
{
view
->
itemsize
/=
dict
->
shape
[
i
];
}
}
view
->
strides
=
NULL
;
view
->
suboffsets
=
NULL
;
...
...
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