Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/fosslight_binary/_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_vulnerability_items(self, oss):
nvd_url = ", ".join(nvd_url).strip()

if nvd_url and len(nvd_url) > MAX_EXCEL_URL_LENGTH:
oss.comment += f"\nExceeded the maximum vulnerability URL length of {MAX_EXCEL_URL_LENGTH} characters."
oss.comment = f"Exceeded the maximum vulnerability URL length of {MAX_EXCEL_URL_LENGTH} characters."
return nvd_url

def get_print_binary_only(self):
Expand Down
23 changes: 15 additions & 8 deletions src/fosslight_binary/_jar_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ def get_oss_info_from_pkg_info(pkg_info):


def analyze_jar_file(path_to_find_bin, path_to_exclude):
remove_owasp_item = []
owasp_items = {}
remove_vulnerability_items = []
vulnerability_items = {}
Expand Down Expand Up @@ -261,14 +260,22 @@ def analyze_jar_file(path_to_find_bin, path_to_exclude):
vulnerability_items = get_vulnerability_info(file_with_path, vulnerability, vulnerability_items, remove_vulnerability_items)

if oss_name != "" or oss_ver != "" or oss_license != "" or oss_dl_url != "":
oss = OssItem(oss_name, oss_ver, oss_license, oss_dl_url)
oss.comment = "OWASP result"
oss_list_for_file = owasp_items.get(file_with_path, [])

remove_owasp_item = owasp_items.get(file_with_path)
if remove_owasp_item:
remove_owasp_item.append(oss)
else:
owasp_items[file_with_path] = [oss]
existing_oss = None
for item in oss_list_for_file:
if item.name == oss_name and item.version == oss_ver:
existing_oss = item
break

if not existing_oss:
oss = OssItem(oss_name, oss_ver, oss_license, oss_dl_url)
oss.comment = "OWASP result"

if file_with_path in owasp_items:
owasp_items[file_with_path].append(oss)
else:
owasp_items[file_with_path] = [oss]
except Exception as ex:
logger.debug(f"Error to get depency Info in jar_contets: {ex}")
success = False
Expand Down