boostorg / icl

Boost.org icl module
http://boost.org/libs/icl
10 stars 44 forks source link

Fix invalid insertion hint to underlying set container #8

Closed davelgraphcore closed 6 years ago

davelgraphcore commented 7 years ago

The code in the add_segment function tries to get the prior of an iterator that may be the first iterator of the underlying set container. This is then used as an insertion hint which causes a segfault in some standard container libraries.

The fix is to use cyclic_prior instead.

This is a fix for ticket #12872.

davelgraphcore commented 7 years ago

I'm not too familiar with the code-base so this may not be the correct fix but it does fix the issue for me. I wasn't sure where to add a test case...