Skip to content

Commit 2e62be3

Browse files
authored
feat(checker): add indent checker (#4774)
Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent dea16ca commit 2e62be3

File tree

6 files changed

+49
-0
lines changed

6 files changed

+49
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
"i2pd",
142142
"icecast",
143143
"icu",
144+
"indent",
144145
"iperf3",
145146
"ipmitool",
146147
"ipsec_tools",

cve_bin_tool/checkers/indent.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for indent
7+
8+
https://www.cvedetails.com/product/157667/GNU-Indent.html?vendor_id=72
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class IndentChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"GNU indent[a-zA-Z0-9_%/+:`' \"\(\)\-\.\r\n]*([0-9]+\.[0-9]+\.[0-9]+)"
21+
]
22+
VENDOR_PRODUCT = [("gnu", "indent")]
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/indent.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
mapping_test_data = [
5+
{"product": "indent", "version": "2.2.12", "version_strings": ["GNU indent 2.2.12"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/i/",
10+
"package_name": "indent-2.2.13-9.fc42.aarch64.rpm",
11+
"product": "indent",
12+
"version": "2.2.13",
13+
},
14+
{
15+
"url": "http://ftp.debian.org/debian/pool/main/i/indent/",
16+
"package_name": "indent_2.2.12-1_amd64.deb",
17+
"product": "indent",
18+
"version": "2.2.12",
19+
},
20+
{
21+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/",
22+
"package_name": "indent-2.2.12-r0.apk",
23+
"product": "indent",
24+
"version": "2.2.12",
25+
},
26+
]

0 commit comments

Comments
 (0)