File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,9 @@ def __init__(self, value):
2828 self .vulnerability_items = []
2929 self .binary_name_without_path = ""
3030 self .bin_name_with_path = value
31- self .found_in_owasp = False
3231 self .is_binary = True
32+ self .found_in_owasp = False
33+ self .found_in_bin_db = False # for debugging
3334
3435 def __del__ (self ):
3536 pass
Original file line number Diff line number Diff line change @@ -43,11 +43,20 @@ def get_oss_info_from_db(bin_info_list, dburl=""):
4343 for idx , row in df_result .iterrows ():
4444 if not item .found_in_owasp :
4545 oss_from_db = OssItem (row ['ossname' ], row ['ossversion' ], row ['license' ])
46- bin_oss_items .append (oss_from_db )
46+
47+ if bin_oss_items :
48+ if not any (oss_item .name == oss_from_db .name
49+ and oss_item .version == oss_from_db .version
50+ and oss_item .license == oss_from_db .license
51+ for oss_item in bin_oss_items ):
52+ bin_oss_items .append (oss_from_db )
53+ else :
54+ bin_oss_items .append (oss_from_db )
4755
4856 if bin_oss_items :
4957 item .set_oss_items (bin_oss_items )
5058 item .comment = "Binary DB result"
59+ item .found_in_binary = True
5160
5261 disconnect_lge_bin_db ()
5362 return bin_info_list , _cnt_auto_identified
You can’t perform that action at this time.
0 commit comments