From fba453fb442ca250330a75da6b444f7fd67caa18 Mon Sep 17 00:00:00 2001 From: Ryan Mast <3969255+nightlark@users.noreply.github.com> Date: Fri, 19 Apr 2024 09:06:57 +0800 Subject: [PATCH] Fix bug with iterating through and adding containers to CycloneDX SBOM (#167) --- surfactant/output/cyclonedx_writer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/surfactant/output/cyclonedx_writer.py b/surfactant/output/cyclonedx_writer.py index 2bf503b6..8387f40b 100644 --- a/surfactant/output/cyclonedx_writer.py +++ b/surfactant/output/cyclonedx_writer.py @@ -48,7 +48,8 @@ def write_sbom(sbom: SBOM, outfile) -> None: # Create CycloneDX Components for every software entry # start with software entries that act as containers for other software entries if sbom.has_relationship(xUUID=software.UUID, relationship="Contains"): - for _, container in convert_software_to_cyclonedx_container_components(software): + _, container_list = convert_software_to_cyclonedx_container_components(software) + for container in container_list: bom.components.add(container) else: for parent_uuid, _, file in convert_software_to_cyclonedx_file_components(software):