From 047d8805ab04f313ab929cf87c494b3444948325 Mon Sep 17 00:00:00 2001 From: Quentin Kaiser <569494+qkaiser@users.noreply.github.com> Date: Fri, 17 Oct 2025 10:54:44 +0200 Subject: [PATCH 1/2] fix(handlers): fix incomplete ordering in YAFFSEntry (reported by CodeQL) Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- python/unblob/handlers/filesystem/yaffs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/unblob/handlers/filesystem/yaffs.py b/python/unblob/handlers/filesystem/yaffs.py index 06b28d8395..3b40585de8 100644 --- a/python/unblob/handlers/filesystem/yaffs.py +++ b/python/unblob/handlers/filesystem/yaffs.py @@ -1,3 +1,4 @@ +import functools import io import itertools from collections import defaultdict @@ -187,6 +188,7 @@ class YAFFSConfig: ecc: bool +@functools.total_ordering @attrs.define class YAFFSEntry: object_type: YaffsObjectType From 9801617c8e9c0a330a7092048410cf83df6d943d Mon Sep 17 00:00:00 2001 From: Krisztian Fekete <1246751+e3krisztian@users.noreply.github.com> Date: Mon, 17 Nov 2025 16:46:33 +0100 Subject: [PATCH 2/2] chore(yaffs): remove unused ordering methods It looks like the ordering methods of YAFFSEntry is unused, but tricks other tools into proposing even more complete unused ordering implementation. --- python/unblob/handlers/filesystem/yaffs.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/python/unblob/handlers/filesystem/yaffs.py b/python/unblob/handlers/filesystem/yaffs.py index 3b40585de8..3b132c4134 100644 --- a/python/unblob/handlers/filesystem/yaffs.py +++ b/python/unblob/handlers/filesystem/yaffs.py @@ -1,4 +1,3 @@ -import functools import io import itertools from collections import defaultdict @@ -188,7 +187,6 @@ class YAFFSConfig: ecc: bool -@functools.total_ordering @attrs.define class YAFFSEntry: object_type: YaffsObjectType @@ -206,18 +204,6 @@ class YAFFSEntry: st_mtime: int = attrs.field(default=0) st_ctime: int = attrs.field(default=0) - def __lt__(self, other): - return self.object_id < other.object_id - - def __gt__(self, other): - return self.object_id > other.object_id - - def __eq__(self, other): - return self.object_id == other.object_id - - def __hash__(self): - return hash(self.object_id) - def __str__(self): return f"{self.object_id}: {self.name}"