Skip to content

Commit a315199

Browse files
committed
fix: fix xerces CPE ID
apache:xerces-c has been deprecated in favor of apache-xerces-c\+\+ since February 2023: <cpe-item name="cpe:/a:apache:xerces-c:3.1.1" deprecated="true" deprecation_date="2023-02-05T21:10:01.860Z"> <reference href="https://marc.info/?l=xerces-c-users&amp;m=157653840106914&amp;w=2">Advisory</reference> <reference href="https://xerces.apache.org/xerces-c/releases_archive.html">Version</reference> <cpe-23:cpe23-item name="cpe:2.3:a:apache:xerces-c:3.1.1:*:*:*:*:*:*:*"> <cpe-23:deprecated-by name="cpe:2.3:a:apache:xerces-c\+\+:3.1.1:*:*:*:*:*:*:*" type="NAME_CORRECTION"/> Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 0e9749a commit a315199

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cve_bin_tool/checkers/xerces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ class XercesChecker(Checker):
2020
r"\/xerces-c-src_([0-9]+_[0-9]+_[0-9]+)\/",
2121
r"xercesc_([0-9]+\_[0-9]+):",
2222
]
23-
VENDOR_PRODUCT = [("apache", "xerces-c\+\+")]
23+
VENDOR_PRODUCT = [("apache", "xerces-c\\+\\+")]

test/test_data/xerces.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
mapping_test_data = [
55
{
6-
"product": "xerces-c\+\+",
6+
"product": "xerces-c\\+\\+",
77
"version": "3.1.1",
88
"version_strings": ["/xerces-c-src_3_1_1/"],
99
}
@@ -12,7 +12,7 @@
1212
{
1313
"url": "http://mirror.centos.org/centos/7/os/x86_64/Packages/",
1414
"package_name": "xerces-c-3.1.1-10.el7_7.x86_64.rpm",
15-
"product": "xerces-c\+\+",
15+
"product": "xerces-c\\+\\+",
1616
"version": "3.1",
1717
}
1818
]

test/test_scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@ def test_version_mapping(self, product, version, version_strings):
138138
f"{'.'.join(list(product))}-{version}.out",
139139
]
140140
for filename in filenames:
141-
# Replace space in filename to avoid a failure on Windows
141+
# Replace colon and backslash in filename to avoid a failure on Windows
142142
with tempfile.NamedTemporaryFile(
143143
"w+b",
144-
suffix=filename.replace(":", "_"),
144+
suffix=filename.replace(":", "_").replace("\\", "_"),
145145
dir=self.mapping_test_dir,
146146
delete=False,
147147
) as f:

0 commit comments

Comments
 (0)