openzim / libzim

Reference implementation of the ZIM specification
https://download.openzim.org/release/libzim/
GNU General Public License v2.0
166 stars 49 forks source link

Correctly locate part range in which read data. #903

Closed mgautierfr closed 3 months ago

mgautierfr commented 3 months ago

May fix #https://github.com/kiwix/kiwix-android/issues/3827 (to check). Fix https://github.com/kiwix/kiwix-android/issues/3827

As describe in https://en.cppreference.com/w/cpp/algorithm/equal_range, equal_range is undefined behavior if bool(comp(elem, value)) does not imply !bool(comp(value, elem)).

This is the case here for exemple with :

kelson42 commented 3 months ago

This PR has been confirmed to fix the big (on kiwix-android). Waiting @veloman-yunkan review to merge and release.