-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
NullPointerException in Semver for alternative NPM versions #5158
Comments
This will be fixed when the next version of |
The error is still present.
|
I am observing the same error with the latest version 7.4.2
|
@jeremylong @Redirts and @alexdu98 indeed there was a problem with ranges parsing. I fixed it in 4.1.1, hope it's help. Version is already released, should be available soon. |
Describe the bug
Follow-up to #5128, seems not to be fully fixed yet: I receive a
NullPointerException
from the NodePackageAnalyzer when analyzing a package-lock.json. Exception message does slightly differ from the trace in the linked earlier issue though:Version of dependency-check used
latest main as of writing -> e84cb80 (run via the CLI within a container, using the included Dockerfile)
To Reproduce
Adding a few quick debug logs in DependencyBundlingAnalyzer shows that in my current/specific case
npmVersionsMatch
is invoked with argumentscurrent = "^14.14.20 || ^16.0.0"
andnext = "18.11.5"
, which seems to originate from the following snippet in thepackage-lock.json
:Similar to #5128 (comment), this seems to be sufficient to trigger the NPE:
Note
Based on the comment in the code I'm not sure if the check in
DependencyCheck/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
Lines 616 to 617 in e84cb80
The text was updated successfully, but these errors were encountered: