diff --git a/CHANGELOG.md b/CHANGELOG.md index 316908267..f30a4cc28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - lint: disable rule caching during linting @Maijin #2817 - vmray: skip processes with invalid PID or missing filename @EclipseAditya #2807 - render: use default styling for dynamic -vv API/call details so they are easier to see @devs6186 #1865 +- address: fix TypeError when sorting locations containing mixed address types @devs6186 #2195 ### capa Explorer Web - webui: fix 404 for "View rule in capa-rules" by using encodeURIComponent for rule name in URL @devs6186 #2482 diff --git a/capa/features/address.py b/capa/features/address.py index eb708a3dc..31b5d8203 100644 --- a/capa/features/address.py +++ b/capa/features/address.py @@ -189,6 +189,11 @@ def __eq__(self, other): def __lt__(self, other): return False + def __gt__(self, other): + # Mixed-type comparison: (real_address < NO_ADDRESS) invokes this so sort works. + # NoAddress sorts last. + return other is not self + def __hash__(self): return hash(0)