Skip to content

Commit

Permalink
fix: Default to UNKNOWN in java version checker (#1637)
Browse files Browse the repository at this point in the history
  • Loading branch information
terriko committed Apr 14, 2022
1 parent aa49424 commit 2d22c68
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cve_bin_tool/version_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ def run_java_checker(self, filename: str) -> Iterator[ScanInfo]:
version = root.find(schema + "version").text
if version is None and parent is not None:
version = parent.find(schema + "version").text

# If no version has been found, set version to UNKNOWN
if version is None:
version = "UNKNOWN"

# Check valid version identifier (i.e. starts with a digit)
if not version[0].isdigit():
self.logger.debug(f"Invalid {version} detected in {filename}")
Expand Down

0 comments on commit 2d22c68

Please sign in to comment.