diff --git a/pyproject.toml b/pyproject.toml index 238a76f..f28d57f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "appthreat-vulnerability-db" -version = "5.5.7" +version = "5.5.8" description = "AppThreat's vulnerability database and package search library with a built-in file based storage. OSV, CVE, GitHub, npm are the primary sources of vulnerabilities." authors = [ {name = "Team AppThreat", email = "cloud@appthreat.com"}, diff --git a/test/test_utils.py b/test/test_utils.py index c4cf349..5b21ca3 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -693,3 +693,4 @@ def test_parse_purl(): "qualifiers": None, "subpath": None, } + assert utils.parse_purl("pkg:gem/remote:@https:%2F%2Frubygems.org%2F") == {} diff --git a/vdb/lib/db.py b/vdb/lib/db.py index fd9c859..64bc933 100644 --- a/vdb/lib/db.py +++ b/vdb/lib/db.py @@ -219,6 +219,10 @@ def bulk_index_search(pkg_list): # Fallback to using type as the vendor vendor = pkg_type name = purl_obj.get("name") + # Handle invalid purl that could lead to name becoming None + # See #81 + if not name: + name = pkg.get("name") version = purl_obj.get("version") else: vendor = pkg.get("vendor")