fix(iter_filter): add bound check for iter filter context#1608
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses several issues related to the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to fix a bounds check issue in the iterator filter context. The changes in src/index/iterator_filter.cpp correctly add bounds checks to SetPoint and CheckPoint, preventing potential out-of-bounds memory access. The addition of an empty graph check in src/algorithm/hgraph.cpp also improves robustness.
However, the modifications in src/algorithm/hnswlib/hnswalg.cpp and src/impl/basic_searcher.cpp appear to be problematic. They remove a necessary de-duplication check for candidates, which could lead to incorrect search results and performance issues. Furthermore, the changes do not fully resolve the underlying out-of-bounds access vulnerability. I have provided suggestions to correctly fix the potential crash while maintaining the de-duplication logic.
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (70.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## 0.16 #1608 +/- ##
==========================================
+ Coverage 92.21% 92.30% +0.08%
==========================================
Files 295 295
Lines 15677 15688 +11
==========================================
+ Hits 14457 14481 +24
+ Misses 1220 1207 -13
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
cp #1588 to 0.16
link #1579 #1580