Skip to content

[3.10] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431) - #27472

Merged
ambv merged 1 commit into
python:3.10from
erlend-aasland:backport-7e311e4-3.10
Jul 30, 2021
Merged

[3.10] bpo-31746: Prevent segfaults when sqlite3.Connection is uninitialised (GH-27431)#27472
ambv merged 1 commit into
python:3.10from
erlend-aasland:backport-7e311e4-3.10

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented Jul 30, 2021

Copy link
Copy Markdown
Contributor

(cherry picked from commit 7e311e4)

Co-authored-by: Erlend Egeberg Aasland erlend.aasland@innova.no

https://bugs.python.org/issue31746

…ialised (pythonGH-27431).
(cherry picked from commit 7e311e4)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

cc. @pablogsal

@ambv
ambv merged commit 0cb470e into python:3.10Jul 30, 2021
@erlend-aasland
erlend-aasland deleted the backport-7e311e4-3.10 branch July 30, 2021 12:02
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

Thanks, @ambv 🙏🏻

rc = sqlite3_exec(self->db, "COMMIT", NULL, NULL, NULL);
Py_END_ALLOW_THREADS
if (rc != SQLITE_OK) {
return _pysqlite_seterror(self->db, NULL);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

Confirmed that _pysqlite_seterror is indeed different in 3.10 compared to main:
https://github.com/python/cpython/blob/3.10/Modules/_sqlite/util.h#L38

@erlend-aaslanderlend-aaslandJul 30, 2021

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was changed in GH-26535GH-25915, which was not backported.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@ambv@the-knights-who-say-ni@bedevere-bot