Skip to content

Commit db4961e

Browse files
authored
fix: update linuxptp checker (#5279)
Update linuxptp pattern to catch version with 3 digits (e.g., 3.1.1). This issue is raised since the addition of the checker in 2024 Fix bbed296 Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 9535cb9 commit db4961e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

cve_bin_tool/checkers/linuxptp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class LinuxptpChecker(Checker):
1717
CONTAINS_PATTERNS: list[str] = []
1818
FILENAME_PATTERNS: list[str] = []
1919
VERSION_PATTERNS = [
20-
r"[ \n]+(?:ptp|PTP_)[A-Za-z0-9_:% \[\]\-\.\r\n]*\r?\n([0-9]\.[0-9])\r?\n"
20+
r"[ \n]+(?:ptp|PTP_)[A-Za-z0-9_:% \[\]\-\.\r\n]*\r?\n([0-9]+\.[0-9]+(\.[0-9]+)?)\r?\n"
2121
]
2222
VENDOR_PRODUCT = [("linuxptp_project", "linuxptp")]
Binary file not shown.

test/test_data/linuxptp.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
"product": "linuxptp",
1818
"version": "3.1",
1919
},
20+
{
21+
"url": "http://ftp.debian.org/debian/pool/main/l/linuxptp/",
22+
"package_name": "linuxptp_3.1.1-4+b2_amd64.deb",
23+
"product": "linuxptp",
24+
"version": "3.1.1",
25+
},
2026
{
2127
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/packages/",
2228
"package_name": "linuxptp_2.0-3_x86_64.ipk",

0 commit comments

Comments
 (0)