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
a24869ad
Kaydet (Commit)
a24869ad
authored
Tem 16, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#3312: fix two sqlite3 crashes.
üst
4ed9be73
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
3 deletions
+29
-3
regression.py
Lib/sqlite3/test/regression.py
+14
-0
NEWS
Misc/NEWS
+2
-0
connection.c
Modules/_sqlite/connection.c
+9
-2
module.c
Modules/_sqlite/module.c
+4
-1
No files found.
Lib/sqlite3/test/regression.py
Dosyayı görüntüle @
a24869ad
...
...
@@ -153,6 +153,20 @@ class RegressionTests(unittest.TestCase):
con
.
execute
(
"insert into foo(bar) values (5)"
)
con
.
execute
(
SELECT
)
def
CheckRegisterAdapter
(
self
):
"""
See issue 3312.
"""
self
.
assertRaises
(
TypeError
,
sqlite
.
register_adapter
,
{},
None
)
def
CheckSetIsolationLevel
(
self
):
"""
See issue 3312.
"""
con
=
sqlite
.
connect
(
":memory:"
)
self
.
assertRaises
(
UnicodeEncodeError
,
setattr
,
con
,
"isolation_level"
,
u"
\xe9
"
)
def
suite
():
regression_suite
=
unittest
.
makeSuite
(
RegressionTests
,
"Check"
)
...
...
Misc/NEWS
Dosyayı görüntüle @
a24869ad
...
...
@@ -63,6 +63,8 @@ Core and Builtins
Library
-------
- Issue #3312: Fix two crashes in sqlite3.
- Issue #1608818: Fix misbehavior in os.listdir() if readdir() fails.
- Issue #3125: Remove copy_reg in multiprocessing and replace it with
...
...
Modules/_sqlite/connection.c
Dosyayı görüntüle @
a24869ad
...
...
@@ -940,6 +940,7 @@ static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, Py
{
PyObject
*
res
;
PyObject
*
begin_statement
;
char
*
begin_statement_str
;
Py_XDECREF
(
self
->
isolation_level
);
...
...
@@ -972,12 +973,18 @@ static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, Py
return
-
1
;
}
self
->
begin_statement
=
PyMem_Malloc
(
PyString_Size
(
begin_statement
)
+
2
);
begin_statement_str
=
PyString_AsString
(
begin_statement
);
if
(
!
begin_statement_str
)
{
Py_DECREF
(
begin_statement
);
return
-
1
;
}
self
->
begin_statement
=
PyMem_Malloc
(
strlen
(
begin_statement_str
)
+
2
);
if
(
!
self
->
begin_statement
)
{
Py_DECREF
(
begin_statement
);
return
-
1
;
}
strcpy
(
self
->
begin_statement
,
PyString_AsString
(
begin_statement
)
);
strcpy
(
self
->
begin_statement
,
begin_statement_str
);
Py_DECREF
(
begin_statement
);
}
...
...
Modules/_sqlite/module.c
Dosyayı görüntüle @
a24869ad
...
...
@@ -147,6 +147,7 @@ static PyObject* module_register_adapter(PyObject* self, PyObject* args)
{
PyTypeObject
*
type
;
PyObject
*
caster
;
int
rc
;
if
(
!
PyArg_ParseTuple
(
args
,
"OO"
,
&
type
,
&
caster
))
{
return
NULL
;
...
...
@@ -159,7 +160,9 @@ static PyObject* module_register_adapter(PyObject* self, PyObject* args)
pysqlite_BaseTypeAdapted
=
1
;
}
microprotocols_add
(
type
,
(
PyObject
*
)
&
pysqlite_PrepareProtocolType
,
caster
);
rc
=
microprotocols_add
(
type
,
(
PyObject
*
)
&
pysqlite_PrepareProtocolType
,
caster
);
if
(
rc
==
-
1
)
return
NULL
;
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
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