diff --git a/cve_bin_tool/checkers/zlib.py b/cve_bin_tool/checkers/zlib.py index 00e442b526..4253912c95 100644 --- a/cve_bin_tool/checkers/zlib.py +++ b/cve_bin_tool/checkers/zlib.py @@ -26,9 +26,8 @@ class ZlibChecker(Checker): ] FILENAME_PATTERNS = [r"libz.so."] VERSION_PATTERNS = [ - r"deflate ([01]+\.[0-9]+(?:\.[0-9]+)?) ", - r"inflate ([01]+\.[0-9]+(?:\.[0-9]+)?) ", - r"libz.so.([01]+\.[0-9]+(?:\.[0-9]+)?)", # patterns like this aren't ideal + r"(?:de|in)flate ([01]+(\.[0-9]+){1,3}) Copyright 1995-", + r"libz.so.([01]+(\.[0-9]+){1,3})", # patterns like this aren't ideal ] VENDOR_PRODUCT = [("gnu", "zlib"), ("zlib", "zlib")] diff --git a/test/test_data/varnish.py b/test/test_data/varnish.py index 6ebb1f75e4..ca057a6fda 100644 --- a/test/test_data/varnish.py +++ b/test/test_data/varnish.py @@ -27,5 +27,6 @@ "package_name": "varnish-7.7.3-r0.apk", "product": "varnish_cache", "version": "7.7.3", + "other_products": ["zlib"], }, ] diff --git a/test/test_data/zlib.py b/test/test_data/zlib.py index 10756a1969..bfb379cfd3 100644 --- a/test/test_data/zlib.py +++ b/test/test_data/zlib.py @@ -21,6 +21,13 @@ "deflate 1.2.11 Copyright 1995-2017 Jean-loup Gailly and Mark Adler" ], }, + { + "product": "zlib", + "version": "1.3.0.1", + "version_strings": [ + " deflate 1.3.0.1 Copyright 1995-2023 Jean-loup Gailly and Mark Adler" + ], + }, ] package_test_data = [ {