Skip to content

fix: name calculation#5266

Merged
jeremylong merged 1 commit intodependency-check:mainfrom
khoelldobler:fix/node_modules-in-package-name
Jan 10, 2023
Merged

fix: name calculation#5266
jeremylong merged 1 commit intodependency-check:mainfrom
khoelldobler:fix/node_modules-in-package-name

Conversation

@khoelldobler
Copy link
Copy Markdown
Contributor

Fixes Issue

Description of Change

The current name calculation just looks for the last occurence of the string "node_modules" and calculates a substring after the occurence plus 1 arbitrary additional character. However, if this string is used as part of the package name the calculation ist wrong and the dependency check crashes with:
"Could not perform Node Audit analysis. Invalid payload submitted to Node Audit API".

We ran into this problem as we updated to the latest gradle plugin version due to #5220 and having "node_modules-path" as a transitive dependency.

I added the slash to the indexOf check to ensure the right pattern is matched.

Have test cases been added to cover the new functionality?

no

@boring-cyborg boring-cyborg Bot added the core changes to core label Jan 10, 2023
@jeremylong jeremylong changed the title fix name calculation fix: name calculation Jan 10, 2023
@jeremylong jeremylong added this to the 8.0.0 milestone Jan 10, 2023
@jeremylong jeremylong merged commit 94634c6 into dependency-check:main Jan 10, 2023
@jeremylong
Copy link
Copy Markdown
Collaborator

thanks for the PR!

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 17, 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.

2 participants