Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jul 30, 2021

(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
Contributor Author

cc. @pablogsal

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

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
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

Copy link
Contributor Author

@erlend-aasland erlend-aasland Jul 30, 2021

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-26535 GH-25915, which was not backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants