Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible out-of-bound access for nb_neighbor function #4177

Closed
sunyinqi0508 opened this issue Feb 7, 2025 · 2 comments
Closed

Possible out-of-bound access for nb_neighbor function #4177

sunyinqi0508 opened this issue Feb 7, 2025 · 2 comments

Comments

@sunyinqi0508
Copy link

sunyinqi0508 commented Feb 7, 2025

Hello, I noticed the nb_neighbor function is not bound checked, and this function is directly accessible in the Python API where out-of-bound access will return raw memory contents without any warning or error message.

I think this is quite dangerous especially in APIs for memory managed languages where people usually assume bound checks.

Image

@bshethmeta
Copy link
Contributor

Let me investigate.

bshethmeta added a commit to bshethmeta/faiss that referenced this issue Feb 13, 2025
Summary: Based on this users comment it seems like we should do bound checking: facebookresearch#4177

Differential Revision: D69497295
facebook-github-bot pushed a commit that referenced this issue Feb 14, 2025
Summary:
Pull Request resolved: #4185

Based on this users comment it seems like we should do bound checking: #4177

Reviewed By: mnorris11

Differential Revision: D69497295

fbshipit-source-id: 97025cf29c464afb0f85aa98f4b303489b7fc989
@bshethmeta
Copy link
Contributor

You are right. I've added a bounds check. #4185

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

No branches or pull requests

2 participants