Skip to content

guard oversized string length in ResultText#1402

Merged
mattn merged 1 commit into
mattn:masterfrom
dxbjavid:guard-resulttext-oversize
Jun 3, 2026
Merged

guard oversized string length in ResultText#1402
mattn merged 1 commit into
mattn:masterfrom
dxbjavid:guard-resulttext-oversize

Conversation

@dxbjavid

@dxbjavid dxbjavid commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

ResultText passes C.int(len(s)) straight through, but ResultBlob already rejects len > math.MaxInt32 on 64-bit. A custom function returning a string over 2 GiB wraps to a negative length, and SQLite then derives the byte count with strlen over the Go string buffer, reading past it. Mirror the existing ResultBlob check so the oversize case returns SQLITE_TOOBIG.

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.53%. Comparing base (18cdded) to head (2af23f7).
⚠️ Report is 86 commits behind head on master.

Files with missing lines Patch % Lines
sqlite3_context.go 0.00% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1402      +/-   ##
==========================================
+ Coverage   47.16%   51.53%   +4.37%     
==========================================
  Files          12       13       +1     
  Lines        1533     1859     +326     
==========================================
+ Hits          723      958     +235     
- Misses        669      742      +73     
- Partials      141      159      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mattn mattn merged commit b3b5216 into mattn:master Jun 3, 2026
11 checks passed
@mattn

mattn commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Thank you

@dxbjavid

dxbjavid commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review and merge! Appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants