sqlite: reject statement-less SQLTagStore queries - #65152
Open
lazerg wants to merge 2 commits into
Open
Conversation
Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
Collaborator
|
Review requested:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #65152 +/- ##
=======================================
Coverage 90.32% 90.32%
=======================================
Files 759 759
Lines 248325 248345 +20
Branches 46861 46875 +14
=======================================
+ Hits 224303 224322 +19
+ Misses 15467 15462 -5
- Partials 8555 8561 +6
🚀 New features to boost your workflow:
|
islandryu
approved these changes
Aug 9, 2026
Renegade334
reviewed
Aug 9, 2026
Renegade334
left a comment
Member
There was a problem hiding this comment.
#65157 is the correct approach here, there's no point in allowing a null statement to be constructed and added to the tag store cache in the first place. We should reject these at the point of preparation.
That being said, this should also be the case for db.prepare()
meixg
reviewed
Aug 9, 2026
Signed-off-by: Lazizbek Ergashev <lazerg2@gmail.com>
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.
Fixes: #65149
A query that holds no statement, such as
sql.run`-- comment`, segfaults every SQLTagStore method.sqlite3_prepare_v2()returnsSQLITE_OKwith a nullsqlite3_stmt*for input that is only a comment or whitespace, andResetAndBindStatement()passes that null pointer straight tosqlite3_clear_bindings().StatementSyncalready models a null statement as finalized, so this checks for it and throwsERR_INVALID_STATE, the same errordb.prepare('-- comment').run()gives today.