Skip to content

fix(index): add MAX_SEARCH_SIZE bounds to prevent OOM#88

Merged
poyrazK merged 2 commits intomainfrom
fix/search-size-bounds
Apr 30, 2026
Merged

fix(index): add MAX_SEARCH_SIZE bounds to prevent OOM#88
poyrazK merged 2 commits intomainfrom
fix/search-size-bounds

Conversation

@poyrazK
Copy link
Copy Markdown
Owner

@poyrazK poyrazK commented Apr 30, 2026

Summary

Test plan

  • cargo test --package cloudsearch-index — all 84 tests pass
  • cargo test --package cloudsearch-api — all 24 tests pass
  • cargo clippy --workspace --all-targets -- -D warnings -D clippy::pedantic — clean

Clamp size and from in search() to prevent OOM from unbounded result
allocation. Add validation in validate_search_request() to fail fast on
requests that exceed limits.

MAX_SEARCH_SIZE = 10,000
MAX_SEARCH_OFFSET = 1,000,000

Fixes: #83
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

Warning

Rate limit exceeded

@poyrazK has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 16 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: cd8808de-c825-48b5-9a54-158329edeea7

📥 Commits

Reviewing files that changed from the base of the PR and between 244956f and ea9a385.

📒 Files selected for processing (2)
  • rust/crates/cloudsearch-index/src/lib.rs
  • rust/crates/cloudsearch-index/tests/coverage.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/search-size-bounds

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
Review rate limit: 0/1 reviews remaining, refill in 27 minutes and 16 seconds.

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

Copy link
Copy Markdown
Owner Author

@poyrazK poyrazK left a comment

Choose a reason for hiding this comment

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

It's okay to merge

@poyrazK poyrazK merged commit d572f12 into main Apr 30, 2026
4 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.

search: unbounded __TEXT __DATA __OBJC others dec hex parameter allows OOM via large result allocation

1 participant