@cyclonedx/cdxgen 8.0.1 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyclonedx/cdxgen",
3
- "version": "8.0.1",
3
+ "version": "8.0.2",
4
4
  "description": "Creates CycloneDX Software Bill-of-Materials (SBOM) from source or container image",
5
5
  "homepage": "http://github.com/cyclonedx/cdxgen",
6
6
  "author": "Prabhu Subramanian <prabhu@appthreat.com>",
package/utils.js CHANGED
@@ -3616,6 +3616,10 @@ const parseComposerLock = function (pkgLockFile) {
3616
3616
  for (let compScope in packages) {
3617
3617
  for (let i in packages[compScope]) {
3618
3618
  const pkg = packages[compScope][i];
3619
+ // Be extra cautious. Potential fix for #236
3620
+ if (!pkg || !pkg.name || !pkg.version) {
3621
+ continue;
3622
+ }
3619
3623
  let group = path.dirname(pkg.name);
3620
3624
  if (group === ".") {
3621
3625
  group = "";
package/utils.test.js CHANGED
@@ -1285,6 +1285,23 @@ test("parseComposerLock", () => {
1285
1285
  }
1286
1286
  ]
1287
1287
  });
1288
+
1289
+ deps = utils.parseComposerLock("./test/data/composer-3.lock");
1290
+ expect(deps.length).toEqual(62);
1291
+ expect(deps[0]).toEqual({
1292
+ group: "amphp",
1293
+ name: "amp",
1294
+ version: "2.6.2",
1295
+ repository: {
1296
+ type: "git",
1297
+ url: "https://github.com/amphp/amp.git",
1298
+ reference: "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb"
1299
+ },
1300
+ license: ["MIT"],
1301
+ description: "A non-blocking concurrency framework for PHP applications.",
1302
+ scope: "required",
1303
+ properties: [{ name: "SrcFile", value: "./test/data/composer-3.lock" }]
1304
+ });
1288
1305
  });
1289
1306
 
1290
1307
  test("parseGemfileLockData", async () => {