diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9570e34..a52e15d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -42,7 +42,7 @@ repos: args: ["--line-length=132"] - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.21 + rev: v0.15.22 hooks: - id: ruff args: ["--fix", "--exit-non-zero-on-fix"] diff --git a/objutils/image.py b/objutils/image.py index 8a28d05..83c8642 100644 --- a/objutils/image.py +++ b/objutils/image.py @@ -505,6 +505,7 @@ def contains_range(self, addr: int, size: int) -> bool: # Find the first section that could contain current_addr import bisect from operator import attrgetter + idx = bisect.bisect_right(self.sections, current_addr, key=attrgetter("start_address")) - 1 if idx < 0: idx = 0