Mercurial > cpython-lru_cache-weakref
diff Modules/_sqlite/connection.c @ 59374:ecca703bc0df 3.1
Issue #7670: sqlite3: Fixed crashes when operating on closed connections.
| author | Gerhard Häring <gh@ghaering.de> |
|---|---|
| date | Fri, 05 Mar 2010 15:55:55 +0000 |
| parents | 98f42392835b |
| children | 92f256174154 |
line wrap: on
line diff
--- a/Modules/_sqlite/connection.c Fri Mar 05 14:45:49 2010 +0000 +++ b/Modules/_sqlite/connection.c Fri Mar 05 15:55:55 2010 +0000 @@ -690,6 +690,10 @@ int narg; int rc; + if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { + return NULL; + } + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "siO", kwlist, &name, &narg, &func)) { @@ -719,6 +723,10 @@ static char *kwlist[] = { "name", "n_arg", "aggregate_class", NULL }; int rc; + if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { + return NULL; + } + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "siO:create_aggregate", kwlist, &name, &n_arg, &aggregate_class)) { return NULL; @@ -809,6 +817,10 @@ static char *kwlist[] = { "authorizer_callback", NULL }; int rc; + if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { + return NULL; + } + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O:set_authorizer", kwlist, &authorizer_cb)) { return NULL; @@ -834,6 +846,10 @@ static char *kwlist[] = { "progress_handler", "n", NULL }; + if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { + return NULL; + } + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi:set_progress_handler", kwlist, &progress_handler, &n)) { return NULL; @@ -948,6 +964,10 @@ PyObject* weakref; int rc; + if (!pysqlite_check_thread(self) || !pysqlite_check_connection(self)) { + return NULL; + } + if (!PyArg_ParseTuple(args, "O", &sql)) { return NULL; }
