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
8699950b
Kaydet (Commit)
8699950b
authored
May 19, 2010
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #6697: Check that _PyUnicode_AsString() result is not NULL in _sqlite
Strip also some trailing spaces
üst
f6c57832
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
connection.c
Modules/_sqlite/connection.c
+5
-3
cursor.c
Modules/_sqlite/cursor.c
+2
-2
row.c
Modules/_sqlite/row.c
+2
-0
statement.c
Modules/_sqlite/statement.c
+4
-1
No files found.
Modules/_sqlite/connection.c
Dosyayı görüntüle @
8699950b
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* Copyright (C) 2004-2010 Gerhard Hring <gh@ghaering.de>
* Copyright (C) 2004-2010 Gerhard Hring <gh@ghaering.de>
*
*
* This file is part of pysqlite.
* This file is part of pysqlite.
*
*
* This software is provided 'as-is', without any express or implied
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
* warranty. In no event will the authors be held liable for any damages
* arising from the use of this software.
* arising from the use of this software.
...
@@ -495,7 +495,9 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
...
@@ -495,7 +495,9 @@ void _pysqlite_set_result(sqlite3_context* context, PyObject* py_val)
}
else
if
(
PyFloat_Check
(
py_val
))
{
}
else
if
(
PyFloat_Check
(
py_val
))
{
sqlite3_result_double
(
context
,
PyFloat_AsDouble
(
py_val
));
sqlite3_result_double
(
context
,
PyFloat_AsDouble
(
py_val
));
}
else
if
(
PyUnicode_Check
(
py_val
))
{
}
else
if
(
PyUnicode_Check
(
py_val
))
{
sqlite3_result_text
(
context
,
_PyUnicode_AsString
(
py_val
),
-
1
,
SQLITE_TRANSIENT
);
char
*
str
=
_PyUnicode_AsString
(
py_val
);
if
(
str
!=
NULL
)
sqlite3_result_text
(
context
,
str
,
-
1
,
SQLITE_TRANSIENT
);
}
else
if
(
PyObject_CheckBuffer
(
py_val
))
{
}
else
if
(
PyObject_CheckBuffer
(
py_val
))
{
if
(
PyObject_AsCharBuffer
(
py_val
,
&
buffer
,
&
buflen
)
!=
0
)
{
if
(
PyObject_AsCharBuffer
(
py_val
,
&
buffer
,
&
buflen
)
!=
0
)
{
PyErr_SetString
(
PyExc_ValueError
,
"could not convert BLOB to buffer"
);
PyErr_SetString
(
PyExc_ValueError
,
"could not convert BLOB to buffer"
);
...
@@ -892,7 +894,7 @@ static int _progress_handler(void* user_arg)
...
@@ -892,7 +894,7 @@ static int _progress_handler(void* user_arg)
}
}
/* abort query if error occurred */
/* abort query if error occurred */
rc
=
1
;
rc
=
1
;
}
else
{
}
else
{
rc
=
(
int
)
PyObject_IsTrue
(
ret
);
rc
=
(
int
)
PyObject_IsTrue
(
ret
);
Py_DECREF
(
ret
);
Py_DECREF
(
ret
);
...
...
Modules/_sqlite/cursor.c
Dosyayı görüntüle @
8699950b
...
@@ -368,7 +368,7 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
...
@@ -368,7 +368,7 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
}
}
PyOS_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"Could not decode to UTF-8 column '%s' with text '%s'"
,
PyOS_snprintf
(
buf
,
sizeof
(
buf
)
-
1
,
"Could not decode to UTF-8 column '%s' with text '%s'"
,
colname
,
val_str
);
colname
,
val_str
);
buf_bytes
=
PyByteArray_FromStringAndSize
(
buf
,
strlen
(
buf
));
buf_bytes
=
PyByteArray_FromStringAndSize
(
buf
,
strlen
(
buf
));
if
(
!
buf_bytes
)
{
if
(
!
buf_bytes
)
{
PyErr_SetString
(
pysqlite_OperationalError
,
"Could not decode to UTF-8"
);
PyErr_SetString
(
pysqlite_OperationalError
,
"Could not decode to UTF-8"
);
}
else
{
}
else
{
...
@@ -533,7 +533,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
...
@@ -533,7 +533,7 @@ PyObject* _pysqlite_query_execute(pysqlite_Cursor* self, int multiple, PyObject*
}
}
operation_cstr
=
_PyUnicode_AsStringAndSize
(
operation
,
&
operation_len
);
operation_cstr
=
_PyUnicode_AsStringAndSize
(
operation
,
&
operation_len
);
if
(
operation
==
NULL
)
if
(
operation
_cstr
==
NULL
)
goto
error
;
goto
error
;
/* reset description and rowcount */
/* reset description and rowcount */
...
...
Modules/_sqlite/row.c
Dosyayı görüntüle @
8699950b
...
@@ -83,6 +83,8 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
...
@@ -83,6 +83,8 @@ PyObject* pysqlite_row_subscript(pysqlite_Row* self, PyObject* idx)
return
item
;
return
item
;
}
else
if
(
PyUnicode_Check
(
idx
))
{
}
else
if
(
PyUnicode_Check
(
idx
))
{
key
=
_PyUnicode_AsString
(
idx
);
key
=
_PyUnicode_AsString
(
idx
);
if
(
key
==
NULL
)
return
NULL
;
nitems
=
PyTuple_Size
(
self
->
description
);
nitems
=
PyTuple_Size
(
self
->
description
);
...
...
Modules/_sqlite/statement.c
Dosyayı görüntüle @
8699950b
...
@@ -130,7 +130,10 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
...
@@ -130,7 +130,10 @@ int pysqlite_statement_bind_parameter(pysqlite_Statement* self, int pos, PyObjec
break
;
break
;
case
TYPE_UNICODE
:
case
TYPE_UNICODE
:
string
=
_PyUnicode_AsString
(
parameter
);
string
=
_PyUnicode_AsString
(
parameter
);
rc
=
sqlite3_bind_text
(
self
->
st
,
pos
,
string
,
-
1
,
SQLITE_TRANSIENT
);
if
(
string
!=
NULL
)
rc
=
sqlite3_bind_text
(
self
->
st
,
pos
,
string
,
-
1
,
SQLITE_TRANSIENT
);
else
rc
=
-
1
;
break
;
break
;
case
TYPE_BUFFER
:
case
TYPE_BUFFER
:
if
(
PyObject_AsCharBuffer
(
parameter
,
&
buffer
,
&
buflen
)
==
0
)
{
if
(
PyObject_AsCharBuffer
(
parameter
,
&
buffer
,
&
buflen
)
==
0
)
{
...
...
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