From 4fdacc2cb77c4d57f1f39a970031157b162e551c Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Sun, 17 Dec 2023 11:39:04 +0100 Subject: [PATCH] fix: update binutils pattern Update binutils pattern to avoid a false positive in libtool.info-1 raised by libbfd-2.9.0.so Signed-off-by: Fabrice Fontaine --- cve_bin_tool/checkers/binutils.py | 5 ++++- test/test_data/binutils.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cve_bin_tool/checkers/binutils.py b/cve_bin_tool/checkers/binutils.py index 64e5e09c2d..cdc597252c 100644 --- a/cve_bin_tool/checkers/binutils.py +++ b/cve_bin_tool/checkers/binutils.py @@ -79,5 +79,8 @@ class BinutilsChecker(Checker): # distro-specific names r"ld.bfd", # as seen on ubuntu ] - VERSION_PATTERNS = [r"libbfd-((\d+\.)*\d+)[\d\w.-]*so"] + VERSION_PATTERNS = [ + r"GNU Binutils[a-zA-Z ]*\) ((\d+\.)*\d+)", + r"BFD header file version %s\r?\nversion ((\d+\.)*\d+)", + ] VENDOR_PRODUCT = [("gnu", "binutils")] diff --git a/test/test_data/binutils.py b/test/test_data/binutils.py index 99f726d210..577a5e77a7 100644 --- a/test/test_data/binutils.py +++ b/test/test_data/binutils.py @@ -7,7 +7,7 @@ "version": "2.31.1", "version_strings": [ "Using the --size-sort and --undefined-only options together", - "libbfd-2.31.1-system.so", + "(GNU Binutils for Ubuntu) 2.31.1", "Auxiliary filter for shared object symbol table", ], }