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
fd24f9e5
Kaydet (Commit)
fd24f9e5
authored
Agu 20, 2012
tarafından
Stefan Krah
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #15732: Fix (constructed) crash in _PySequence_BytesToCharpArray().
Found by Coverity.
üst
e56bf97e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
test_capi.py
Lib/test/test_capi.py
+13
-0
abstract.c
Objects/abstract.c
+5
-0
No files found.
Lib/test/test_capi.py
Dosyayı görüntüle @
fd24f9e5
...
@@ -10,6 +10,10 @@ import sys
...
@@ -10,6 +10,10 @@ import sys
import
time
import
time
import
unittest
import
unittest
from
test
import
support
from
test
import
support
try
:
import
_posixsubprocess
except
ImportError
:
_posixsubprocess
=
None
try
:
try
:
import
threading
import
threading
except
ImportError
:
except
ImportError
:
...
@@ -55,6 +59,15 @@ class CAPITest(unittest.TestCase):
...
@@ -55,6 +59,15 @@ class CAPITest(unittest.TestCase):
def
test_memoryview_from_NULL_pointer
(
self
):
def
test_memoryview_from_NULL_pointer
(
self
):
self
.
assertRaises
(
ValueError
,
_testcapi
.
make_memoryview_from_NULL_pointer
)
self
.
assertRaises
(
ValueError
,
_testcapi
.
make_memoryview_from_NULL_pointer
)
@unittest.skipUnless
(
_posixsubprocess
,
'_posixsubprocess required for this test.'
)
def
test_seq_bytes_to_charp_array
(
self
):
# Issue #15732: crash in _PySequence_BytesToCharpArray()
class
Z
(
object
):
def
__len__
(
self
):
return
1
self
.
assertRaises
(
TypeError
,
_posixsubprocess
.
fork_exec
,
1
,
Z
(),
3
,[
1
,
2
],
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
)
@unittest.skipUnless
(
threading
,
'Threading required for this test.'
)
@unittest.skipUnless
(
threading
,
'Threading required for this test.'
)
class
TestPendingCalls
(
unittest
.
TestCase
):
class
TestPendingCalls
(
unittest
.
TestCase
):
...
...
Objects/abstract.c
Dosyayı görüntüle @
fd24f9e5
...
@@ -2736,6 +2736,11 @@ _PySequence_BytesToCharpArray(PyObject* self)
...
@@ -2736,6 +2736,11 @@ _PySequence_BytesToCharpArray(PyObject* self)
for
(
i
=
0
;
i
<
argc
;
++
i
)
{
for
(
i
=
0
;
i
<
argc
;
++
i
)
{
char
*
data
;
char
*
data
;
item
=
PySequence_GetItem
(
self
,
i
);
item
=
PySequence_GetItem
(
self
,
i
);
if
(
item
==
NULL
)
{
/* NULL terminate before freeing. */
array
[
i
]
=
NULL
;
goto
fail
;
}
data
=
PyBytes_AsString
(
item
);
data
=
PyBytes_AsString
(
item
);
if
(
data
==
NULL
)
{
if
(
data
==
NULL
)
{
/* NULL terminate before freeing. */
/* NULL terminate before freeing. */
...
...
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