Skip to content

Commit

Permalink
Fixing bug when key does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxToffy committed Oct 21, 2024
1 parent 6c1c618 commit a16f4b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions impacket/winregistry.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,8 +660,11 @@ def enumKey(self, key):
def enumValues(self,key):
path = self.__keyToNodePath(key)
node = self.__findNode(path)
values = list(node.data.keys())
return [s.encode('utf-8') for s in values]
if not node:
return None
else:
values = list(node.data.keys())
return [s.encode('utf-8') for s in values]

def getValue(self, keyValue, valueName=None):
""" returns a tuple with (ValueType, ValueData) for the requested keyValue
Expand Down

0 comments on commit a16f4b8

Please sign in to comment.