m1n1.utils: Fix len() overflow in RangeMap

This is to fix

  OverflowError: Python int too large to convert to C ssize_t

in case the upper bound of a range is 1<<64.

Signed-off-by: Martin Povišer <povik@cutebit.org>
This commit is contained in:
Martin Povišer 2022-08-01 10:40:29 +02:00 committed by Hector Martin
parent 7db691737e
commit 020d86a23f

View file

@ -519,7 +519,7 @@ class RangeMap(Reloadable):
def _overlap_range(self, zone, split=False):
zone = self.__zone(zone)
if len(zone) == 0:
if not zone:
return 0, 0
start = bisect.bisect_left(self.__end, zone.start)