8000 gh-79579: Improve DML query detection in sqlite3 by erlend-aasland · Pull Request #93623 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-79579: Improve DML query detection in sqlite3 #93623

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
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
Prev Previous commit
Next Next commit
Reword comment
  • Loading branch information
erlend-aasland committed Jun 9, 2022
commit 61a81eb23ca6212edcd7c05fd858898f2938a87b
10 changes: 4 additions & 6 deletions Modules/_sqlite/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,13 @@ stmt_traverse(pysqlite_Statement *self, visitproc visit, void *arg)
}

/*
* Strips leading whitespace and SQL comments from input string and returns a
* Strip leading whitespace and comments from SQL string and return a
* pointer to the first non-whitespace, non-comment character.
*
* This is used to check if somebody tried to execute more than one SQL command
* with one execute()/executemany() command, which the DB-API and we don't
* allow.
* This is used to check if somebody tries to execute more than one SQL query
* with one execute()/executemany() command, which the DB-API don't allow.
*
* It is also used to strip leading whitespace and comments from input SQL
* queries, so we can easily detect DML queries.
* It is also used to harden DML query detection.
*/
static const char *
lstrip_sql(const char *sql)
Expand Down
0