Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent infinite looping and out of memory errors #1482 #1490

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions volatility3/framework/plugins/windows/handles.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def _generator(self, procs):
try:
obj_name = entry.NameInfo.Name.String
except (ValueError, exceptions.InvalidAddressException):
obj_name = ""
obj_name = None

except exceptions.InvalidAddressException:
vollog.log(
Expand All @@ -359,7 +359,7 @@ def _generator(self, procs):
format_hints.Hex(entry.HandleValue),
obj_type,
format_hints.Hex(entry.GrantedAccess),
obj_name,
obj_name or renderers.NotAvailableValue(),
),
)

Expand Down
9 changes: 9 additions & 0 deletions volatility3/framework/symbols/windows/extensions/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,17 @@ def _skip_key_hive_entry_path(self, kcb_flags):

def get_full_key_name(self) -> str:
output = []
seen = set()

kcb = self.KeyControlBlock
while kcb.ParentKcb:
if kcb.ParentKcb.vol.offset in seen:
return None
seen.add(kcb.ParentKcb.vol.offset)

if len(output) > 128:
return None

if kcb.NameBlock.Name is None:
break

Expand Down
Loading