Skip to content

Commit

Permalink
Fix empty Set get method
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-sgaron committed Aug 30, 2021
1 parent f6d12f4 commit f8e8270
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assemblyline/common/heuristics.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ def get_safelist_key(t_type: str, t_value: str) -> str:

def get_safelist(ds):
if not ds:
return set({})
return {}
return {get_safelist_key('signature', sl['signature']['name']): True
for sl in ds.safelist.stream_search("type:signature AND enabled:true", fl="signature.name", as_obj=False)}


class HeuristicHandler():
def __init__(self, datastore=None):
self.datastore = datastore
self.safelist = CachedObject(get_safelist, kwargs={'ds': self.datastore}, refresh=300) if datastore else set({})
self.safelist = CachedObject(get_safelist, kwargs={'ds': self.datastore}, refresh=300) if datastore else {}

def service_heuristic_to_result_heuristic(self, srv_heuristic, heuristics, zerioize_on_sig_safe=True):
heur_id = srv_heuristic['heur_id']
Expand Down

0 comments on commit f8e8270

Please sign in to comment.