-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Fix out of bounds for heap-array in statistical outlier filter #5502
Conversation
The arrays need to hold one more item, since we want to skip over the query point in the results
Hi, thanks for this pull request. The changes look good, but I would be interested to know: did this actually cause a problem for you, i.e. did you notice an out-of-bounds access? To my knowledge, all search methods resize the indices and dists arrays anyway (no-op if they already have the correct size), so after the first call to |
Hi Markus, I agree that often the knn-do resizing; but in this case the "nearestKSearch" API suggests that the output vectors must be resized to match k. This triggered an asan error when we added this filtering the other day; here is the beginning of the asan output.
|
The OOB refers to the nn_dists vector:
|
I guess #5092 would solve this as well? |
Maybe, but I think that needs some more discussion, so I would prefer to merge the fix from this pull request already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @simonlynen !
Thanks for the review! Looks like I'm not authorized to merge PRs onto master, can you please do that for me? |
I will do that, but I wanted to wait for @larshg 's reply first |
The arrays need to hold one more item, since we want to skip over the query point in the results