[bug] Get Registry Tome Errors when an Entry is Empty
Closed this issue · 0 comments
Cictrone commented
Describe the bug
When running the Get Registry
tome and providing an empty registry entry the eldritch will error like so:
The issue appears to be that we do not check the length of the results keys before doing a list comprehension:
def pad_key(key, max_len):
res = key+" "*(max_len-len(key))
return res
def get_registry(hive, path):
res = sys.get_reg(hive, path)
max_len = max([ len(i) for i in res.keys()]) # <------ we should check `res` before this
for k in res:
v = res[k]
pk = pad_key(k,max_len)
print(f"{pk} : {v}")
get_registry(input_params['hive'], input_params['path'])
print()
To Reproduce
Steps to reproduce the behavior:
- Run the Tome providing an empty entry
- Observe the output above
Expected behavior
It should probably either return a nicer to read error or just an empty response