Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bpo-43296: Handle sqlite3_value_blob() errors#24674

Merged
berkerpeksag merged 5 commits into
python:masterpython/cpython:masterfrom
erlend-aasland:bpo-43296/bloberlend-aasland/cpython:bpo-43296/blobCopy head branch name to clipboard
Apr 14, 2021
Merged

bpo-43296: Handle sqlite3_value_blob() errors#24674
berkerpeksag merged 5 commits into
python:masterpython/cpython:masterfrom
erlend-aasland:bpo-43296/bloberlend-aasland/cpython:bpo-43296/blobCopy head branch name to clipboard

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented Feb 28, 2021

Copy link
Copy Markdown
Contributor
  • sqlite3_value_blob() should be called before sqlite3_value_bytes()
  • handle sqlite3_value_blob() out-of-memory errors

https://bugs.python.org/issue43296

@erlend-aasland

Copy link
Copy Markdown
Contributor Author

@berkerpeksag / @serhiy-storchaka: would one of you mind reviewing this?

Erlend E. Aasland added 5 commits March 10, 2021 14:44
https://sqlite.org/c3ref/value_blob.html:
"As long as the input parameter is correct, these routines can only fail if an
out-of-memory error occurs during a format conversion."
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

FYI: Rebased onto master to trigger CI again.

@github-actions

Copy link
Copy Markdown

This PR is stale because it has been open for 30 days with no activity.

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Apr 10, 2021
cur_py_value = PyBytes_FromStringAndSize(
sqlite3_value_blob(cur_value), buflen);
case SQLITE_BLOB: {
sqlite3 *db = sqlite3_context_db_handle(context);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe it may make sense to see what other core devs think about declaring new variables inside case.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well, there's plenty of other such cases in the code base: grep -A1 -rE "\<case\>.*:.*{" Modules

@berkerpeksag berkerpeksag merged commit 5cb601f into python:master Apr 14, 2021
@erlend-aasland erlend-aasland deleted the bpo-43296/blob branch April 14, 2021 21:09
@erlend-aasland

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing, @berkerpeksag !

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

Labels

stale Stale PR or inactive for long period of time.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.