File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def __init__(self, value):
2929 self .binary_name_without_path = ""
3030 self .bin_name_with_path = value
3131 self .found_in_owasp = False
32- self .is_binary = True
32+ self .found_in_bin_db = False
3333
3434 def __del__ (self ):
3535 pass
Original file line number Diff line number Diff line change @@ -45,14 +45,30 @@ def get_oss_info_from_db(bin_info_list, dburl=""):
4545 oss_from_db = OssItem (row ['ossname' ], row ['ossversion' ], row ['license' ])
4646 bin_oss_items .append (oss_from_db )
4747
48+ if bin_oss_items :
49+ remove_same_item (bin_oss_items )
50+
4851 if bin_oss_items :
4952 item .set_oss_items (bin_oss_items )
5053 item .comment = "Binary DB result"
54+ item .found_in_binary = True
5155
5256 disconnect_lge_bin_db ()
5357 return bin_info_list , _cnt_auto_identified
5458
5559
60+ def remove_same_item (db_oss_items : list ):
61+ key_set = set ()
62+ unique_oss_list = []
63+
64+ for item in db_oss_items :
65+ key = (item .name , item .version )
66+ if key not in key_set :
67+ key_set .add (key )
68+ unique_oss_list .append (item )
69+ db_oss_items [:] = unique_oss_list
70+
71+
5672def get_connection_string (dburl ):
5773 # dburl format : 'postgresql://username:password@host:port/database_name'
5874 connection_string = ""
You can’t perform that action at this time.
0 commit comments