Skip to content

Commit

Permalink
Core: Fix array_of_pointers to act only on those pointers
Browse files Browse the repository at this point in the history
Previously in array_of_pointers we were updating the vol dict for the
base pointer type.  Now we clone it before modifying it, so we're only
interfering with that one type, not any future types.

Fixes #922
  • Loading branch information
ikelos committed Nov 26, 2023
1 parent 8b6ab44 commit e8d70b5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions volatility3/framework/objects/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ def array_of_pointers(
raise TypeError(
"Subtype must be a valid template (or string name of an object template)"
)
# We have to clone the pointer class, or we'll be defining the pointer subtype for all future pointers
subtype_pointer = context.symbol_space.get_type(
symbol_table + constants.BANG + "pointer"
).clone()
)
subtype_pointer.update_vol(subtype=subtype)
return array.cast("array", count=count, subtype=subtype_pointer)

0 comments on commit e8d70b5

Please sign in to comment.