Repository navigation
sqlite: fix abort on oversized SQL text - #67768
Merged
nodejs-github-bot merged 1 commit intoNov 27, 2026
Merged
Conversation
Collaborator
|
Review requested:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67768 +/- ##
==========================================
- Coverage 90.54% 90.51% -0.03%
==========================================
Files 803 805 +2
Lines 285293 285821 +528
Branches 55069 55196 +127
==========================================
+ Hits 258311 258712 +401
- Misses 17102 17199 +97
- Partials 9880 9910 +30
🚀 New features to boost your workflow:
|
araujogui
approved these changes
Nov 26, 2026
| Isolate* isolate = env->isolate(); | ||
| HandleScope handle_scope(isolate); | ||
|
|
||
| // With an explicit length, V8 returns an empty handle instead of aborting |
Member
There was a problem hiding this comment.
nit: comments are a bit wordy, we can trim them.
Member
Author
There was a problem hiding this comment.
Agreed, trimmed both.
`expandedSQL`, `sourceSQL`, column names and the `sqlite.db.query` trace callback passed SQL text to `String::NewFromUtf8()` without a length, and V8 aborted on text longer than `String::kMaxLength`. Pass the length instead. The getters and column names now throw `ERR_STRING_TOO_LONG`, and the trace callback skips the event so the statement still runs. Co-authored-by: lazerg <lazerg2@gmail.com> Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
christianaurichzm
force-pushed
the
sqlite-oversized-sql-text
branch
from
November 26, 2026 20:20
f25ae20 to
cd2ad81
Compare
jasnell
approved these changes
Nov 26, 2026
Collaborator
Collaborator
|
Landed in 2fdac69 |
gabylb
pushed a commit
to gabylb/node
that referenced
this pull request
Nov 27, 2026
`expandedSQL`, `sourceSQL`, column names and the `sqlite.db.query` trace callback passed SQL text to `String::NewFromUtf8()` without a length, and V8 aborted on text longer than `String::kMaxLength`. Pass the length instead. The getters and column names now throw `ERR_STRING_TOO_LONG`, and the trace callback skips the event so the statement still runs. Co-authored-by: lazerg <lazerg2@gmail.com> Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com> PR-URL: nodejs#67768 Fixes: nodejs#66487 Refs: nodejs#66498 Reviewed-By: Guilherme Araújo <arauujogui@gmail.com> Reviewed-By: James M Snell <jasnell@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.
expandedSQL,sourceSQL, result column names and thesqlite.db.querytrace callback abort the process on SQL text longer thanString::kMaxLengthin UTF-8:With a
sqlite.db.querysubscriber,run()alone aborts too.These call sites pass the text to
String::NewFromUtf8()without a length, and V8 then aborts instead of returning an empty handle. This routes the getters and column names through the helpers that column values already use, so they throwERR_STRING_TOO_LONG. The trace callback passes the length and skips the event on an empty handle.This picks up #66498 by @lazerg.
Fixes: #66487
Refs: #66498