Skip to content

fix [BUG] Array out-of-bounds read in token_is_col_id() - liboracle_p… - #1170

Merged
gaoxueyu merged 1 commit into
IvorySQL:masterfrom
pierreforstmann:patch1
Jan 26, 2026
Merged

gaoxueyu merged 1 commit into
IvorySQL:masterfrom
pierreforstmann:patch1

Conversation

@pierreforstmann

@pierreforstmann pierreforstmann commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor

…arser.c #1159

Summary by CodeRabbit

  • Bug Fixes
    • Improved application stability by adding bounds validation to prevent potential access errors in token processing.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 23, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A defensive bound check is added to the token_is_col_id function to prevent out-of-bounds array access. The code now validates that the index is within the valid range before accessing the OraScanKeywordCategories array.

Changes

Cohort / File(s) Summary
Defensive bound check in token_is_col_id
src/backend/oracle_parser/liboracle_parser.c
Added index validation i < OraScanKeywords.num_keywords before accessing OraScanKeywordCategories[i] to prevent potential out-of-bounds access when token index exceeds array bounds

Possibly related issues

  • IvorySQL/IvorySQL#1159 — Directly addresses the same out-of-bounds vulnerability in token_is_col_id by adding the identical bounds check before array access

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through code with care,
Bounds checked here and bounds checked there,
No more arrays gone astray,
Safe from index overflow today! 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: fixing an array out-of-bounds read bug in the token_is_col_id() function in liboracle_parser.c, which matches the summary of changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@OreoYang

Copy link
Copy Markdown
Contributor

Good catch.
Thanks

@gaoxueyu
gaoxueyu merged commit 3588213 into IvorySQL:master Jan 26, 2026
6 checks passed
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