Skip to content

Commit

Permalink
Make sure composer.lock dependency package version is a string (#1325)
Browse files Browse the repository at this point in the history
composer.lock files may have a dependency package version as a number instead of a string (see: google/osv-scanner#1138). In that case `new PackageURL(...)` throws the following error: Error: Invalid purl: "versions" argument must be a string.

Signed-off-by: Maxime Robert <[email protected]>
  • Loading branch information
marob authored Aug 26, 2024
1 parent f14c0fd commit 82a55b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -7874,7 +7874,7 @@ export function parseComposerLock(pkgLockFile, rootRequires) {
"composer",
group,
name,
pkg.version,
pkg.version?.toString(),
null,
null,
).toString();
Expand All @@ -7883,7 +7883,7 @@ export function parseComposerLock(pkgLockFile, rootRequires) {
name: name,
purl,
"bom-ref": decodeURIComponent(purl),
version: pkg.version,
version: pkg.version?.toString(),
repository: pkg.source,
license: pkg.license,
description: pkg.description,
Expand Down

0 comments on commit 82a55b5

Please sign in to comment.