Skip to content

Commit 7314e5b

Browse files
authored
fix: improve gdb checker (#3520)
Improve gdb pattern to handle openwrt gdb binaries Signed-off-by: Fabrice Fontaine <[email protected]>
1 parent 9a95eca commit 7314e5b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

cve_bin_tool/checkers/gdb.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,8 @@
1616
class GdbChecker(Checker):
1717
CONTAINS_PATTERNS: list[str] = []
1818
FILENAME_PATTERNS: list[str] = []
19-
VERSION_PATTERNS = [r"gdb-([0-9]+\.[0-9]+\.?[0-9]*)"]
19+
VERSION_PATTERNS = [
20+
r"gdb-([0-9]+\.[0-9]+\.?[0-9]*)",
21+
r"\r?\n([0-9]+\.[0-9]+\.?[0-9]*)[A-Za-z0-9<>()!,_=|'`+*&^{} \\\.\-\"\r\n\t]*GDB ",
22+
]
2023
VENDOR_PRODUCT = [("gnu", "gdb")]
790 KB
Binary file not shown.

test/test_data/gdb.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@
2424
"product": "gdb",
2525
"version": "8.2.1",
2626
},
27+
{
28+
"url": "https://downloads.openwrt.org/releases/packages-19.07/x86_64/base/",
29+
"package_name": "gdb_8.3.1-1_x86_64.ipk",
30+
"product": "gdb",
31+
"version": "8.3.1",
32+
},
2733
]

0 commit comments

Comments
 (0)