Skip to content

Commit c708a08

Browse files
authored
new checker - gcc (#926)
1 parent cbe84ba commit c708a08

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

cve_bin_tool/checkers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"expat",
2020
"ffmpeg",
2121
"freeradius",
22+
"gcc",
2223
"gimp",
2324
"gnutls",
2425
"glibc",

cve_bin_tool/checkers/gcc.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/python3
2+
3+
"""
4+
CVE checker for gcc
5+
6+
https://www.cvedetails.com/vulnerability-list/vendor_id-72/product_id-960/GNU-GCC.html
7+
8+
"""
9+
from . import Checker
10+
11+
12+
class GccChecker(Checker):
13+
CONTAINS_PATTERNS = []
14+
FILENAME_PATTTERN = [r"gcc"]
15+
VERSION_PATTERNS = [r"gcc ([0-9]+\.[0-9]+\.[0-9]+)", r"gcc ([0-9]+\.[0-9]+)"]
16+
VENDOR_PRODUCT = [("gnu", "gcc")]

test/test_data/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"expat",
1212
"ffmpeg",
1313
"freeradius",
14+
"gcc",
1415
"gimp",
1516
"glibc",
1617
"gnutls",

test/test_data/gcc.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
mapping_test_data = [
2+
{
3+
"product": "gcc",
4+
"version": "9.3.1",
5+
"version_strings": ["gcc 9.3.1"],
6+
}
7+
]
8+
package_test_data = [
9+
{
10+
"url": "https://kojipkgs.fedoraproject.org/packages/gcc/9.3.1/1.fc30/src/",
11+
"package_name": "gcc-9.3.1-1.fc30.src.rpm",
12+
"product": "gcc",
13+
"version": "9.3.1",
14+
}
15+
]

0 commit comments

Comments
 (0)