-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-43296: Handle sqlite3_value_blob() errors #24674
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
Conversation
@berkerpeksag / @serhiy-storchaka: would one of you mind reviewing this? |
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
FYI: Rebased onto master to trigger CI again. |
This PR is stale because it has been open for 30 days with no activity. |
cur_py_value = PyBytes_FromStringAndSize( | ||
sqlite3_value_blob(cur_value), buflen); | ||
case SQLITE_BLOB: { | ||
sqlite3 *db = sqlite3_context_db_handle(context); |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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
Thanks for reviewing, @berkerpeksag ! |
sqlite3_value_blob()
should be called beforesqlite3_value_bytes()
sqlite3_value_blob()
out-of-memory errorshttps://bugs.python.org/issue43296