diff options
author | Erlend Egeberg Aasland <erlend.aasland@innova.no> | 2021-11-16 14:53:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 14:53:35 (GMT) |
commit | 9d6215a54c177a5e359c37ecd1c50b594b194f41 (patch) | |
tree | d958d7845d5d5c7f2e9b8c41a80207b58a522799 /Modules/_sqlite/clinic | |
parent | 6a84d61c55f2e543cf5fa84522d8781a795bba33 (diff) | |
download | cpython-9d6215a54c177a5e359c37ecd1c50b594b194f41.zip cpython-9d6215a54c177a5e359c37ecd1c50b594b194f41.tar.gz cpython-9d6215a54c177a5e359c37ecd1c50b594b194f41.tar.bz2 |
bpo-45126: Harden `sqlite3` connection initialisation (GH-28227)
Diffstat (limited to 'Modules/_sqlite/clinic')
-rw-r--r-- | Modules/_sqlite/clinic/connection.c.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Modules/_sqlite/clinic/connection.c.h b/Modules/_sqlite/clinic/connection.c.h index 5bfc589..3a3ae04 100644 --- a/Modules/_sqlite/clinic/connection.c.h +++ b/Modules/_sqlite/clinic/connection.c.h @@ -7,7 +7,7 @@ pysqlite_connection_init_impl(pysqlite_Connection *self, const char *database, double timeout, int detect_types, const char *isolation_level, int check_same_thread, PyObject *factory, - int cached_statements, int uri); + int cache_size, int uri); static int pysqlite_connection_init(PyObject *self, PyObject *args, PyObject *kwargs) @@ -25,7 +25,7 @@ pysqlite_connection_init(PyObject *self, PyObject *args, PyObject *kwargs) const char *isolation_level = ""; int check_same_thread = 1; PyObject *factory = (PyObject*)clinic_state()->ConnectionType; - int cached_statements = 128; + int cache_size = 128; int uri = 0; fastargs = _PyArg_UnpackKeywords(_PyTuple_CAST(args)->ob_item, nargs, kwargs, NULL, &_parser, 1, 8, 0, argsbuf); @@ -101,8 +101,8 @@ pysqlite_connection_init(PyObject *self, PyObject *args, PyObject *kwargs) } } if (fastargs[6]) { - cached_statements = _PyLong_AsInt(fastargs[6]); - if (cached_statements == -1 && PyErr_Occurred()) { + cache_size = _PyLong_AsInt(fastargs[6]); + if (cache_size == -1 && PyErr_Occurred()) { goto exit; } if (!--noptargs) { @@ -114,7 +114,7 @@ pysqlite_connection_init(PyObject *self, PyObject *args, PyObject *kwargs) goto exit; } skip_optional_pos: - return_value = pysqlite_connection_init_impl((pysqlite_Connection *)self, database, timeout, detect_types, isolation_level, check_same_thread, factory, cached_statements, uri); + return_value = pysqlite_connection_init_impl((pysqlite_Connection *)self, database, timeout, detect_types, isolation_level, check_same_thread, factory, cache_size, uri); exit: /* Cleanup for database */ @@ -851,4 +851,4 @@ exit: #ifndef PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF #define PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF #endif /* !defined(PYSQLITE_CONNECTION_LOAD_EXTENSION_METHODDEF) */ -/*[clinic end generated code: output=663b1e9e71128f19 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=6f267f20e77f92d0 input=a9049054013a1b77]*/ |