mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
#3312: fix two sqlite3 crashes.
This commit is contained in:
parent
4ed9be733b
commit
a24869ada7
4 changed files with 29 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue