diff options
| author | Zackery Spytz <zspytz@gmail.com> | 2018-12-17 07:52:45 -0700 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-12-17 16:52:45 +0200 |
| commit | 842acaab1376c5c84fd5966bb6070e289880e1ca (patch) | |
| tree | f21283245b7e349d05482b89fde8d570b33c53ab /Modules/_sqlite/connection.c | |
| parent | 4db62e115891425db2a974142a72d8eaaf95eecb (diff) | |
| download | cpython-git-842acaab1376c5c84fd5966bb6070e289880e1ca.tar.gz | |
bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175)
Diffstat (limited to 'Modules/_sqlite/connection.c')
| -rw-r--r-- | Modules/_sqlite/connection.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index aab4b1afd2..e3340bf19f 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -1161,6 +1161,10 @@ static PyObject* pysqlite_connection_get_in_transaction(pysqlite_Connection* sel static int pysqlite_connection_set_isolation_level(pysqlite_Connection* self, PyObject* isolation_level, void *Py_UNUSED(ignored)) { + if (isolation_level == NULL) { + PyErr_SetString(PyExc_AttributeError, "cannot delete attribute"); + return -1; + } if (isolation_level == Py_None) { PyObject *res = pysqlite_connection_commit(self, NULL); if (!res) { |
