bpo-43296: Handle sqlite3_value_blob() errors#24674
Merged
berkerpeksag merged 5 commits intoApr 14, 2021
python:masterpython/cpython:masterfrom
erlend-aasland:bpo-43296/bloberlend-aasland/cpython:bpo-43296/blobCopy head branch name to clipboard
Merged
bpo-43296: Handle sqlite3_value_blob() errors#24674berkerpeksag merged 5 commits intopython:masterpython/cpython:masterfrom erlend-aasland:bpo-43296/bloberlend-aasland/cpython:bpo-43296/blobCopy head branch name to clipboard
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
Contributor
Author
|
@berkerpeksag / @serhiy-storchaka: would one of you mind reviewing this? |
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."
1bb6441 to
32fcc41
Compare
Contributor
Author
|
FYI: Rebased onto master to trigger CI again. |
|
This PR is stale because it has been open for 30 days with no activity. |
berkerpeksag
approved these changes
Apr 14, 2021
| cur_py_value = PyBytes_FromStringAndSize( | ||
| sqlite3_value_blob(cur_value), buflen); | ||
| case SQLITE_BLOB: { | ||
| sqlite3 *db = sqlite3_context_db_handle(context); |
Member
There was a problem hiding this comment.
Maybe it may make sense to see what other core devs think about declaring new variables inside case.
Contributor
Author
There was a problem hiding this comment.
Well, there's plenty of other such cases in the code base: grep -A1 -rE "\<case\>.*:.*{" Modules
Contributor
Author
|
Thanks for reviewing, @berkerpeksag ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
sqlite3_value_blob()should be called beforesqlite3_value_bytes()sqlite3_value_blob()out-of-memory errorshttps://bugs.python.org/issue43296