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 loading of NVD API results when there are none #1039

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

n-thumann
Copy link
Member

What

This PR fixes the loading of NVD API results when there are none.

Why

E.g. https://services.nvd.nist.gov/rest/json/cves/2.0?lastModStartDate=2024-08-13T11%3A29%3A45%2B00%3A00&lastModEndDate=2024-08-13T11%3A30%3A15%2B00%3A00&startIndex=0&resultsPerPage=2000 returns an empty list of results.
This caused self._current_request_results to be 0 (because there are 0 total results available), so raise NoMoreResults() will be never called. This results in the same request being made over and over again indefinitely.

I added a test case to demonstrate the expected behavior.

References

Checklist

  • Tests

@n-thumann n-thumann requested a review from a team as a code owner August 13, 2024 11:37
Copy link

Conventional Commits Report

Type Number
Added 1
Bug Fixes 1

🚀 Conventional commits found.

@n-thumann n-thumann added the make release To trigger GitHub release action. label Aug 13, 2024
@n-thumann n-thumann force-pushed the fix_nvd_api_empty_results branch from 5f038c5 to 4cc4d17 Compare September 3, 2024 09:50
@n-thumann
Copy link
Member Author

@y0urself Looks like https://github.com/greenbone/pontos/actions/runs/10680616330/workflow failed to enable auto-merge 🤔

@y0urself y0urself merged commit 213e94f into main Sep 3, 2024
20 checks passed
@y0urself y0urself deleted the fix_nvd_api_empty_results branch September 3, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
make release To trigger GitHub release action.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants