Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Jun 13, 2024
1 parent 680b199 commit 2b9f19a
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
26 changes: 22 additions & 4 deletions vdb/lib/aqua.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,9 @@ def alsa_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
vuln.description = compress_str(description)
ret_data.append(vuln)
if vuln:
vuln.description = compress_str(description)
ret_data.append(vuln)
except Exception:
pass
return ret_data
Expand Down Expand Up @@ -293,6 +294,8 @@ def alas_rlsa_to_vuln(cve_data, vendor):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append(vuln)
done_pkgs[pkg_key] = True
Expand Down Expand Up @@ -396,6 +399,8 @@ def ubuntu_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append(vuln)
except Exception:
Expand Down Expand Up @@ -507,6 +512,8 @@ def redhat_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append(vuln)
done_pkgs[pkg_key] = True
Expand Down Expand Up @@ -573,6 +580,8 @@ def arch_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append(vuln)
except Exception:
Expand Down Expand Up @@ -671,6 +680,8 @@ def suse_to_vuln(self, cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append(vuln)
done_pkgs[pkg_key] = True
Expand Down Expand Up @@ -741,8 +752,9 @@ def photon_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
vuln.description = compress_str(description)
ret_data.append(vuln)
if vuln:
vuln.description = compress_str(description)
ret_data.append(vuln)
except Exception:
pass
return ret_data
Expand Down Expand Up @@ -859,6 +871,8 @@ def debian_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append(vuln)
except Exception:
Expand Down Expand Up @@ -924,6 +938,8 @@ def wolfi_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = f"""URL Prefix: {cve_data.get("urlprefix")}. Affected arch: {", ".join(cve_data.get("archs"))}"""
ret_data.append(vuln)
except Exception:
Expand Down Expand Up @@ -978,6 +994,8 @@ def alpine_to_vuln(cve_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = f"{cve_id} is unfixed in {edition}. Visit https://security.alpinelinux.org/vuln/{cve_id} for more details."
ret_data.append(vuln)
except Exception:
Expand Down
2 changes: 2 additions & 0 deletions vdb/lib/gha.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ def convert(self, cve_data):
try:
tdata_json = orjson.loads(tdata)
vuln = NvdSource.convert_vuln(tdata_json)
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append(vuln)
except Exception as e:
Expand Down
2 changes: 2 additions & 0 deletions vdb/lib/npm.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ def to_vuln(self, v, ret_data):
)
try:
vuln = NvdSource.convert_vuln(orjson.loads(tdata))
if vuln is None:
continue
vuln.description = compress_str(description)
ret_data.append([vuln, f"""{v["id"]}|{product}|{used_version}"""])
except Exception as e:
Expand Down

0 comments on commit 2b9f19a

Please sign in to comment.