Skip to content

TrkVertexSeedFinderUtils: Fix out-of-bounds vector access.

In these lines

        std::vector< std::pair< int, int> > idxprevious = (*idxs)[splt-1] ;
        offset = idxprevious[sz].second ;

we seem to want to refer to the last element in idxprevious. But sz is the size of (*idxs)[split], so this can result in an out-of-bounds access. Changed to use back(). Also get rid of some needless vector copies. Fixes crash when compiling with -D_GLIBCXX_ASSERTIONS.

Merge request reports

Loading