Skip to content

Commit 0bbf659

Browse files
committed
feat(checkers): Add clang
1 parent 5ecff54 commit 0bbf659

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"chess",
5454
"chrony",
5555
"civetweb",
56+
"clang",
5657
"clamav",
5758
"collectd",
5859
"commons_compress",

cve_bin_tool/checkers/clang.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (C) 2025 Keysight Technologies
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for clang
7+
8+
https://www.cvedetails.com/product/27514/Llvm-Clang.html?vendor_id=13260
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class ClangChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [r"Clang ([0-9]+\.[0-9]+\.[0-9]+)"]
20+
VENDOR_PRODUCT = [("llvm", "clang")]
Binary file not shown.

test/test_data/clang.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (C) 2025 Keysight Technologies
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{
6+
"product": "clang",
7+
"version": "7.0.0",
8+
"version_strings": ["Clang 7.0.0"],
9+
}
10+
]
11+
package_test_data = [
12+
{
13+
"url": "http://de.archive.ubuntu.com/ubuntu/pool/universe/l/llvm-toolchain-19/",
14+
"package_name": "libclang1-19_19.1.1-1ubuntu1_amd64.deb",
15+
"product": "clang",
16+
"version": "19.1.1",
17+
},
18+
]

0 commit comments

Comments
 (0)