diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-02-04 22:57:44 +0200 |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-02-04 22:57:44 +0200 |
commit | 44a28ecbe2c09fe5ec4959c254fdfe5b6a9fe322 (patch) | |
tree | 007442e524d9584fe16f0d80ad2b8933809f3b1b /Modules/_sqlite/connection.c | |
parent | 2296b978597ce62ec2185b78a43811610af2c0ea (diff) | |
parent | efe8c92c7a269af2f9ded960735e74d62d791330 (diff) | |
download | cpython-44a28ecbe2c09fe5ec4959c254fdfe5b6a9fe322.tar.gz |
Issue #29444: Fixed out-of-bounds buffer access in the group() method of
the match object. Based on patch by WGH.
Diffstat (limited to 'Modules/_sqlite/connection.c')
-rw-r--r-- | Modules/_sqlite/connection.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 1c6aa54c22..37b45f330b 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -400,8 +400,7 @@ error: if (PyErr_Occurred()) { return NULL; } else { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } } @@ -443,8 +442,7 @@ error: if (PyErr_Occurred()) { return NULL; } else { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } } @@ -487,8 +485,7 @@ error: if (PyErr_Occurred()) { return NULL; } else { - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } } @@ -645,7 +642,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_ aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*)); if (*aggregate_instance == 0) { - *aggregate_instance = PyObject_CallFunction(aggregate_class, NULL); + *aggregate_instance = _PyObject_CallNoArg(aggregate_class); if (PyErr_Occurred()) { *aggregate_instance = 0; @@ -933,7 +930,7 @@ static int _progress_handler(void* user_arg) gilstate = PyGILState_Ensure(); #endif - ret = PyObject_CallFunction((PyObject*)user_arg, NULL); + ret = _PyObject_CallNoArg((PyObject*)user_arg); if (!ret) { if (_enable_callback_tracebacks) { @@ -1489,7 +1486,7 @@ pysqlite_connection_create_collation(pysqlite_Connection* self, PyObject* args) PyObject* retval; Py_ssize_t i, len; _Py_IDENTIFIER(upper); - char *uppercase_name_str; + const char *uppercase_name_str; int rc; unsigned int kind; void *data; |