Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit c87f60b

Browse files
committed
Filter out invalid macho headers from AS loading
1 parent b87c464 commit c87f60b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

volatility/plugins/addrspaces/macho.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,10 @@ def parse_macho(self):
8686
self.segs.append(seg)
8787
# Since these values will be used a lot, make sure they aren't reread (ie, no objects in the runs list)
8888
run = (int(seg.vmaddr), int(seg.fileoff), int(seg.vmsize))
89+
90+
self.as_assert(seg.vmaddr > 4096, "Invalid run address")
91+
self.as_assert(self.vmsize >= 4096, "Invalid run size")
92+
8993
self.runs.append(run)
94+
9095
offset = offset + seg.cmdsize

0 commit comments

Comments
 (0)