algolia / instantsearch-ios

⚡️ A library of widgets and helpers to build instant-search applications on iOS.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/ios/
Apache License 2.0
591 stars 55 forks source link

fix(multi-search): crash in case of requests-results count mismatch #261

Closed VladislavFitz closed 1 year ago

VladislavFitz commented 1 year ago

Summary

In AbstractMultiSearcher during the extraction of the subranges of the results, there is no check if the subrange bounds are compatible with the results size (index out of bounds exception). In some circumstances this can provoke a crash.

Result

The crash conditions are checked and an error MultiSearchError.rangeError is thrown to prevent it.