StatisticalOutlierRemoval: fix potential container overflow read#5980
StatisticalOutlierRemoval: fix potential container overflow read#5980mvieth merged 3 commits intoPointCloudLibrary:masterfrom steple:master
Conversation
nearestKSearch might reduce the size of nn_dists.
|
@steple Hi, the only reason I can think of why |
|
I don't have answers to your questions readily available. I ran into this when upgrading compilers, and the new compiler catches this issue in the act (with sanitizers). I'll try to look into it. (I don't usually work in that part of the codebase.) I went for what I thought is obvious fix, but alternatively the could could also assert and explode, I guess. |
|
Ah okay. Which compiler are you using, and which sanitizer? Could this have been a false positive? With static analyzers for example, I have seen several cases where the analyzer has found an issue, but on closer inspection it was a false positive. |
|
clang 17 with asan. The calling code looks somewhat like this and I believe it hit this resize |
Done. |
mvieth
left a comment
There was a problem hiding this comment.
Thanks for the additional information! Just two minor changes (to fix sign-compare problems), then I am happy with the pull request.
|
Thank you for making this quick and easy. |
nearestKSearch might reduce the size of nn_dists.