Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions cve_bin_tool/version_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,13 @@ def __init__(
self.language_checkers = valid_files
self.language_checkers_names = self.available_language_checkers()

if self.no_scan:
self.cve_db = None
else:
self.cve_db = CVEDB(sources=sources)
# if self.no_scan:
# self.cve_db = None
# else:
# self.cve_db = CVEDB(sources=sources)

self._sources = sources
self.cve_db = None

@classmethod
def load_checkers(cls) -> dict[str, type[Checker]]:
Expand Down Expand Up @@ -302,6 +305,9 @@ def run_checkers(self, filename: str, lines: str) -> Iterator[ScanInfo]:
"""process a Set of checker objects, run them on file lines,
and yield information about detected products and versions.
It uses logging to provide debug and error information along the way."""
# Initialize CVE database if not already done and scanning is enabled
if (self.cve_db is None) and (not self.no_scan):
self.cve_db = CVEDB(sources=self._sources)
LOGGER.info(f"filename = {filename}")
# tko
for dummy_checker_name, checker in self.checkers.items():
Expand Down
Loading