Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: NVD API issues (Fixes #2351) #2355

Merged
merged 1 commit into from
Nov 17, 2022
Merged
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
5 changes: 5 additions & 0 deletions cve_bin_tool/data_sources/nvd_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ async def nist_fetch_using_api(self) -> list:
LOGGER.info("[Using NVD API]")
api_version = "1.0"

# Can only do incremental update if database exists
if not db.dbpath.exists():
# Disable incremental update because database doesn't exist
self.incremental_update = False

nvd_api = NVD_API(
logger=self.LOGGER,
error_mode=self.error_mode,
Expand Down
2 changes: 1 addition & 1 deletion cve_bin_tool/nvd_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(
self.api_version = api_version
self.feed = f"{feed}{self.api_version}"
# Version 2.0 API doesn't work with API key
if api_key and self.api_version == 1.0:
if api_key and self.api_version == "1.0":
self.params["apiKey"] = api_key

@staticmethod
Expand Down