From 8bafaf59c95196997f667fe240a9dcf960866a1c Mon Sep 17 00:00:00 2001 From: Ranjan Mangla Date: Fri, 26 Apr 2024 01:58:52 +0530 Subject: [PATCH] fix: improved cpe parsing in sbom code (#4082) Signed-off-by: ranjanmangla1 Co-authored-by: Terri Oda --- cve_bin_tool/sbom_manager/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cve_bin_tool/sbom_manager/__init__.py b/cve_bin_tool/sbom_manager/__init__.py index ca5935679a..f2249c9460 100644 --- a/cve_bin_tool/sbom_manager/__init__.py +++ b/cve_bin_tool/sbom_manager/__init__.py @@ -343,7 +343,8 @@ def decode_cpe22(self, cpe22) -> (str | None, str | None, str | None): """ - cpe = cpe22.split(":") + # split on `:` only if it's not escaped + cpe = re.split(r"(? (str | None, str | None, str | None): """ - cpe = cpe23.split(":") + # split on `:` only if it's not escaped + cpe = re.split(r"(?