- Issue #1471: Arguments to fcntl.ioctl are no longer broken on 64-bit OpenBSD
and similar platforms due to sign extension.
+- Issue #3312: Fix two crashes in sqlite3.
+
+
Tests
-----
{
PyObject* res;
PyObject* begin_statement;
+ char* begin_statement_str;
Py_XDECREF(self->isolation_level);
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);
}
{
PyTypeObject* type;
PyObject* caster;
+ int rc;
if (!PyArg_ParseTuple(args, "OO", &type, &caster)) {
return NULL;
}
- microprotocols_add(type, (PyObject*)&SQLitePrepareProtocolType, caster);
+ rc = microprotocols_add(type, (PyObject*)&SQLitePrepareProtocolType, caster);
+ if (rc == -1)
+ return NULL;
Py_INCREF(Py_None);
return Py_None;