Skip to content

Improve sanitizer robustness in parser and UTF-8 subsequence paths - #103483

Closed
yakov-olkhovskiy wants to merge 38 commits into
masterfrom
cursor/fix-function-prop-fuzzer-sanitizers-6d84
Closed

yakov-olkhovskiy wants to merge 38 commits into
masterfrom
cursor/fix-function-prop-fuzzer-sanitizers-6d84

Conversation

@yakov-olkhovskiy

@yakov-olkhovskiy yakov-olkhovskiy commented Apr 23, 2026 •

Copy link
Copy Markdown
Member

This follows up on sanitizer failures discovered while running CI for #99740.

The branch keeps the original getURLScheme empty-input guard from that work and adds two more hardening fixes that became visible after the first fix:

  • guard Lexer::nextToken max_query_size check against null input pointers (UBSan path);
  • return early in HasSubsequenceImpl::hasSubsequenceUTF8 for empty haystack before first UTF-8 decode (MSan path).

It also adds focused regression coverage:

  • parser gtest for null lexer input with max_query_size;
  • stateless SQL test for empty-haystack UTF-8 subsequence behavior.

Original PR where issues were discovered: #99740

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Improved sanitizer robustness in parser and string-function edge cases: protocol now handles empty input safely in getURLScheme, Lexer::nextToken no longer performs null-pointer arithmetic in max_query_size checks, and UTF-8 subsequence evaluation returns early on empty haystacks before decoding.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)
Open in Web Open in Cursor 

yakov-olkhovskiy and others added 30 commits March 17, 2026 09:16
…x_parser_depth, max_parser_backtracks, max_query_size as options, set max_parser_depth = 100, max_parser_backtracks = 1000
…-workflow-conflicts-7a3b

# Conflicts:
#	.github/workflows/pull_request.yml

Co-authored-by: Yakov Olkhovskiy <[email protected]>
…-workflow-conflicts-7a3b

# Conflicts:
#	.github/workflows/pull_request.yml

Co-authored-by: Yakov Olkhovskiy <[email protected]>
…-workflow-conflicts-7a3b

# Conflicts:
#	.github/workflows/pull_request.yml

Co-authored-by: Yakov Olkhovskiy <[email protected]>
…-workflow-conflicts-7a3b

# Conflicts:
#	.github/workflows/pull_request.yml
#	ci/workflows/pull_request.py

Co-authored-by: Yakov Olkhovskiy <[email protected]>
…ce stacktrace from runner thread instead main
yakov-olkhovskiy and others added 8 commits April 20, 2026 21:48
…-workflow-conflicts-7a3b

# Conflicts:
#	.github/workflows/pull_request.yml

Co-authored-by: Yakov Olkhovskiy <[email protected]>
…-workflow-conflicts-7a3b

# Conflicts:
#	.github/workflows/pull_request.yml

Co-authored-by: Yakov Olkhovskiy <[email protected]>
…-workflow-conflicts-7a3b

# Conflicts:
#	.github/workflows/pull_request.yml

Co-authored-by: Yakov Olkhovskiy <[email protected]>
Fix two sanitizer findings from CI run #99740:

- Guard `Lexer::nextToken` max-query-size check for null input pointers to avoid UBSan pointer arithmetic exception.

- Return early in `HasSubsequenceImpl::hasSubsequenceUTF8` for empty haystack before first UTF-8 decode to avoid MSan uninitialized read exception.

Also add targeted parser/gtest and stateless SQL regression coverage for the new edge cases.

Co-authored-by: Yakov Olkhovskiy <[email protected]>
@CLAassistant

CLAassistant commented Apr 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ yakov-olkhovskiy
✅ alexey-milovidov
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

@cursor cursor Bot changed the title Fix sanitizer findings in function property fuzzer unit tests Improve sanitizer robustness in parser and UTF-8 subsequence paths Apr 24, 2026
@cursor
cursor Bot changed the base branch from revert-99696-revert-99530-ci-libfuzzer-for-prs to master April 24, 2026 05:50
@yakov-olkhovskiy

Copy link
Copy Markdown
Member Author

cleaning AIs mess

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.

4 participants