Skip to content

Commit

Permalink
Fix parsing of pom properties with None values
Browse files Browse the repository at this point in the history
  • Loading branch information
Haim Helman committed Apr 6, 2022
1 parent aa1803a commit 2690848
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions anchore_engine/db/entities/policy_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,8 @@ def get_pom_properties(self):
kv = line.split("=")
key = kv[0].strip()
value = "=".join(kv[1:]).strip()
props[key] = value
if value != "None":
props[key] = value
return props

def find_vulnerabilities(self):
Expand Down Expand Up @@ -2224,8 +2225,13 @@ def find_vulnerabilities(self):
log.debug(
"performing LANGPACK vuln scan {} - {}".format(pkgkey, pkgversion)
)
if pkgkey and pkgversion and likematch:
if (pkgkey or pkg_name_like) and pkgversion and likematch:
if pkg_name_like:
log.debug(
"performing LANGPACK like vuln scan {} - {}".format(
pkg_name_like, pkgversion
)
)
candidates = (
db.query(FixedArtifact)
.filter(FixedArtifact.name.like(pkg_name_like))
Expand Down

0 comments on commit 2690848

Please sign in to comment.