Skip to content

Commit

Permalink
fix: improve pango checker (#2986)
Browse files Browse the repository at this point in the history
Improve pango checker to avoid false positives with upcoming emacs
checker

Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
  • Loading branch information
ffontaine authored May 10, 2023
1 parent 6e807b1 commit 5c2ce74
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cve_bin_tool/checkers/pango.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
class PangoChecker(Checker):
CONTAINS_PATTERNS: list[str] = []
FILENAME_PATTERNS: list[str] = []
VERSION_PATTERNS = [r"([0-9]+\.[0-9]+\.[0-9]+)\r?\n[pP]ango"]
VERSION_PATTERNS = [
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\n/etc/pango",
r"([0-9]+\.[0-9]+\.[0-9]+)\r?\nPango version",
]
VENDOR_PRODUCT = [("gnome", "pango"), ("pango", "pango")]
7 changes: 6 additions & 1 deletion test/test_data/pango.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
# SPDX-License-Identifier: GPL-3.0-or-later

mapping_test_data = [
{
"product": "pango",
"version": "1.40.5",
"version_strings": ["1.40.5\n/etc/pango"],
},
{
"product": "pango",
"version": "1.40.5",
"version_strings": ["1.40.5\nPango version"],
}
},
]
package_test_data = [
{
Expand Down

0 comments on commit 5c2ce74

Please sign in to comment.