File tree Expand file tree Collapse file tree 2 files changed +11
-28
lines changed Expand file tree Collapse file tree 2 files changed +11
-28
lines changed Original file line number Diff line number Diff line change 7
7
8
8
https://www.cvedetails.com/vulnerability-list/vendor_id-45/product_id-59066/Apache-Commons-Compress.html
9
9
"""
10
- import re
11
-
12
10
from cve_bin_tool .checkers import Checker
13
- from cve_bin_tool .util import regex_find
14
11
15
12
16
13
class CommonsCompressChecker (Checker ):
@@ -20,29 +17,6 @@ class CommonsCompressChecker(Checker):
20
17
]
21
18
FILENAME_PATTERNS = [r"commons-compress(-[0-9]+\.[0-9]+(\.[0-9]+)?)?.jar" ]
22
19
VERSION_PATTERNS = [
23
- r"<artifactId>commons-compress- ([0-9]+\.[0-9]+(\.[0-9]+)?)</artifactId >"
20
+ r"<artifactId>commons-compress</artifactId>\n <version> ([0-9]+\.[0-9]+(\.[0-9]+)?)</version >"
24
21
]
25
22
VENDOR_PRODUCT = [("apache" , "commons_compress" )]
26
-
27
- def get_version (self , lines , filename ):
28
- version_info = super ().get_version (lines , filename )
29
- lines = lines .split ("\n " )
30
-
31
- index_value = [
32
- i
33
- for i , line in enumerate (lines )
34
- if re .search ("<artifactId>commons-compress</artifactId>" , line )
35
- ]
36
-
37
- if not index_value :
38
- return version_info
39
- else :
40
- index_value = index_value [0 ]
41
-
42
- version_string = lines [index_value + 1 ]
43
- version_pattern = [r"<version>([0-9]+\.[0-9]+(\.[0-9]+)?)</version>" ]
44
- version_regex = list (map (re .compile , version_pattern ))
45
- new_version = regex_find (version_string , version_regex )
46
- version_info ["version" ] = new_version
47
-
48
- return version_info
Original file line number Diff line number Diff line change 5
5
{
6
6
"product" : "commons_compress" ,
7
7
"version" : "1.18" ,
8
- "version_strings" : ["<artifactId>commons-compress-1.18</artifactId>" ],
8
+ "version_strings" : [
9
+ "<artifactId>commons-compress</artifactId>\n <version>1.18</version>"
10
+ ],
11
+ },
12
+ {
13
+ "product" : "commons_compress" ,
14
+ "version" : "1.15.1" ,
15
+ "version_strings" : [
16
+ "<artifactId>commons-compress</artifactId>\n <version>1.15.1</version>"
17
+ ],
9
18
},
10
19
]
11
20
package_test_data = [
You can’t perform that action at this time.
0 commit comments