[mlpack-git] [mlpack/mlpack] Fixed an error in MidpointSplit that may lead to a segfault (#741)

lozhnikov notifications at github.com
Wed Jul 27 11:09:08 EDT 2016


I tried to compare the vantage point tree with `BallTree` and came across a segfault.

Since `BallBound[d].Mid()` is equal to the center, one child may be empty. In this case the following loop may lead to a segfault (if `right = 0` then `right-1 = SIZE_MAX`)
```
 while ((data(splitDimension, right) >= splitVal) && (left <= right))
   right--;
```
You can view, comment on, or merge this pull request online at:

  https://github.com/mlpack/mlpack/pull/741

-- Commit Summary --

  * Fixed an error in MidpointSplit that may lead to a segfault

-- File Changes --

    M src/mlpack/core/tree/binary_space_tree/midpoint_split_impl.hpp (28)

-- Patch Links --

https://github.com/mlpack/mlpack/pull/741.patch
https://github.com/mlpack/mlpack/pull/741.diff

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/741
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160727/b365d9ee/attachment-0001.html>


More information about the mlpack-git mailing list