Skip to content

Commit 4e7e1f3

Browse files
authored
feat(checker): add zbar (#4981)
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
1 parent bab5f8c commit 4e7e1f3

File tree

6 files changed

+50
-0
lines changed

6 files changed

+50
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@
422422
"xz",
423423
"yasm",
424424
"zabbix",
425+
"zbar",
425426
"zchunk",
426427
"zeek",
427428
"zlib",

cve_bin_tool/checkers/zbar.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright (C) 2025 Orange
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
5+
"""
6+
CVE checker for zbar
7+
8+
https://www.cvedetails.com/product/160348/Zbar-Project-Zbar.html?vendor_id=32703
9+
10+
"""
11+
from __future__ import annotations
12+
13+
from cve_bin_tool.checkers import Checker
14+
15+
16+
class ZbarChecker(Checker):
17+
CONTAINS_PATTERNS: list[str] = []
18+
FILENAME_PATTERNS: list[str] = []
19+
VERSION_PATTERNS = [
20+
r"zbar[a-z\-\r\n]*([0-9]+\.[0-9]+(\.[0-9]+)?)",
21+
r"([0-9]+\.[0-9]+(\.[0-9]+)?)[A-Za-z=:<'/ \(\)\-\r\n]*zbar",
22+
]
23+
VENDOR_PRODUCT = [("zbar_project", "zbar")]
2.17 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.

test/test_data/zbar.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": "zbar", "version": "0.23", "version_strings": ["0.23\nzbar"]}
6+
]
7+
package_test_data = [
8+
{
9+
"url": "http://rpmfind.net/linux/fedora/linux/development/rawhide/Everything/aarch64/os/Packages/z/",
10+
"package_name": "zbar-0.23.93-6.fc42.aarch64.rpm",
11+
"product": "zbar",
12+
"version": "0.23.93",
13+
},
14+
{
15+
"url": "http://ftp.debian.org/debian/pool/main/z/zbar/",
16+
"package_name": "zbar-tools_0.23.90-1+deb11u1_amd64.deb",
17+
"product": "zbar",
18+
"version": "0.23.90",
19+
},
20+
{
21+
"url": "https://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/",
22+
"package_name": "zbar-0.23-r2.apk",
23+
"product": "zbar",
24+
"version": "0.23",
25+
},
26+
]

0 commit comments

Comments
 (0)