Skip to content

Fix out-of-bounds read in parse_base36 and add regression tests#79

Merged
notxvilka merged 1 commit intomainfrom
fix-asan
Feb 18, 2026
Merged

Fix out-of-bounds read in parse_base36 and add regression tests#79
notxvilka merged 1 commit intomainfrom
fix-asan

Conversation

@b1llow
Copy link
Member

@b1llow b1llow commented Feb 17, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 17, 2026 20:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a critical heap-buffer-overflow vulnerability in the parse_base36 function and adds comprehensive regression tests to prevent similar issues in the future.

Changes:

  • Added bounds checking to parse_base36 to prevent out-of-bounds reads when mangled input ends with base36 characters
  • Added regression tests covering multiple scenarios where the vulnerability could be triggered
  • Documented the root cause of the vulnerability in test comments

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/cplusplus/v3/v3.c Added bounds check p->cur + sz < p->end to prevent reading past buffer end in parse_base36
test/unit/test_cxx_rules.c Added comprehensive regression tests for the heap-buffer-overflow vulnerability with multiple test cases

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@notxvilka notxvilka merged commit 37f9e9e into main Feb 18, 2026
15 checks passed
@notxvilka notxvilka deleted the fix-asan branch February 18, 2026 04:25
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