Skip to content

fix: correct NVD cache last checked logic#6218

Merged
jeremylong merged 1 commit intomainfrom
scratch/duration-fix
Dec 5, 2023
Merged

fix: correct NVD cache last checked logic#6218
jeremylong merged 1 commit intomainfrom
scratch/duration-fix

Conversation

@jeremylong
Copy link
Copy Markdown
Collaborator

resolves #6209

@boring-cyborg boring-cyborg Bot added the core changes to core label Dec 4, 2023
@jeremylong jeremylong added this to the 9.0.3 milestone Dec 4, 2023
@jeremylong jeremylong merged commit 4c44019 into main Dec 5, 2023
@jeremylong jeremylong deleted the scratch/duration-fix branch December 5, 2023 11:22
@@ -441,7 +441,7 @@ private boolean checkUpdate() throws UpdateException {
final ZonedDateTime lastChecked = dbProperties.getTimestamp(DatabaseProperties.NVD_CACHE_LAST_CHECKED);
if (lastChecked == null) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be lastChecked != null, otherwise this happens (I did not test the fix, just guessing where the problem is):

Caused by: java.lang.NullPointerException: Cannot invoke "java.time.temporal.TemporalAccessor.query(java.time.temporal.TemporalQuery)" because "temporal" is null
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.checkUpdate(NvdApiDataSource.java:443)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.processDatafeed(NvdApiDataSource.java:117)
        at org.owasp.dependencycheck.data.update.NvdApiDataSource.update(NvdApiDataSource.java:108)
        at org.owasp.dependencycheck.Engine.doUpdates(Engine.java:906)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh - thank you for catching this. i would have been publishing another path release if you hadn't alerted me. seriously - thank you!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

core changes to core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--nvdValidForHours does not work

2 participants