Skip to content

Commit

Permalink
feat(checker): Add gettext (#4741)
Browse files Browse the repository at this point in the history
  • Loading branch information
qmfrederik authored Feb 12, 2025
1 parent 351b8b3 commit cb4d078
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
1 change: 1 addition & 0 deletions cve_bin_tool/checkers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
"gdal",
"gdb",
"gdk_pixbuf",
"gettext",
"ghostscript",
"gimp",
"git",
Expand Down
20 changes: 20 additions & 0 deletions cve_bin_tool/checkers/gettext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (C) 2025 Keysight Technologies
# SPDX-License-Identifier: GPL-3.0-or-later


"""
CVE checker for gettext
https://www.cvedetails.com/product/4701/GNU-Gettext.html
"""
from __future__ import annotations

from cve_bin_tool.checkers import Checker


class GettextChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"/gettext-([0-9]+\.[0-9]+\.[0-9]+)(?:\.[0-9]+)?[-/]"]
VENDOR_PRODUCT = [("gnu", "gettext")]
Binary file not shown.
28 changes: 28 additions & 0 deletions test/test_data/gettext.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright (C) 2025 Keysight Technologies
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "gettext",
"version": "0.19.8",
"version_strings": [
"../../../gettext-0.19.8.1/gettext-tools/gnulib-lib/mbiter.h"
],
},
{
"product": "gettext",
"version": "0.22.3",
"version_strings": [
"/usr/src/gettext/gettext-0.22.3-1.x86_64/src/gettext-0.22.3/gettext-tools/libgettextpo/../src/format-kde-kuit.c"
],
},
]
package_test_data = [
{
"url": "https://ftp-stud.hs-esslingen.de/pub/Mirrors/sources.redhat.com/cygwin/x86_64/release/gettext/libgettextpo0/",
"package_name": "libgettextpo0-0.22.3-1.tar.xz",
"product": "gettext",
"version": "0.22.3",
"other_products": ["gcc"],
},
]

0 comments on commit cb4d078

Please sign in to comment.