Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-118928: sqlite3: correctly bail if sequences of params are used wi…
…th named placeholders

Fix up post gh-118929.
  • Loading branch information
erlend-aasland committed May 20, 2024
commit 4bde862e026dbcdddbdb10f1fb75d92b07f559e6
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix an error where incorrect bindings in :mod:`sqlite3` queries could lead
to a crash.
2 changes: 1 addition & 1 deletion Modules/_sqlite/cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ bind_parameters(pysqlite_state *state, pysqlite_Statement *self,
for (i = 0; i < num_params; i++) {
const char *name = sqlite3_bind_parameter_name(self->st, i+1);
if (name != NULL && name[0] != '?') {
PyErr_Format(state->ProgrammingError,
return PyErr_Format(state->ProgrammingError,
"Binding %d ('%s') is a named parameter, but you "
"supplied a sequence which requires nameless (qmark) "
"placeholders.",
Expand Down