Prevent infinite looping and out of memory errors #1482

This commit is contained in:
Andrew Case
2025-01-24 22:02:27 +00:00
parent a68be50798
commit e9088be0d8
@@ -133,8 +133,17 @@ class CM_KEY_BODY(objects.StructType):
def get_full_key_name(self) -> str:
output = []
seen = set()
kcb = self.KeyControlBlock
while kcb.ParentKcb:
if kcb.ParentKcb.vol.offset in seen:
return ""
seen.add(kcb.ParentKcb.vol.offset)
if len(output) > 128:
return ""
if kcb.NameBlock.Name is None:
break