Skip to content

Commit a6b59f4

Browse files
committed
.
Signed-off-by: ziad hany <ziadhany2016@gmail.com>
1 parent 6e29d6f commit a6b59f4

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

vulnerabilities/pipelines/v2_importers/aosp_importer.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,37 @@ def collect_advisories(self):
8585
references = []
8686
for commit_data in vulnerability_data.get("fixes", []):
8787
vcs_url = commit_data.get("patchUrl")
88+
commit_id = commit_data.get("commitId")
89+
90+
"""
91+
https://us.codeaurora.org/cgit/quic/la/kernel/msm/commit/?id=17bfaf64ad503d2e6607d2d3e0956f25bf07eb43
92+
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=f54e18f1b831c92f6512d2eedb224cd63d607d3d
93+
https://android.googlesource.com/platform/system/bt/+/514139f4b40cbb035bb92f3e24d5a389d75db9e6
94+
https://source.codeaurora.org/quic/la//kernel/msm-4.4/commit/?id=b108c651cae9913da1ab163cb4e5f7f2db87b747
95+
96+
Check if commit in the url split based on it to get the commit hash and the vcs url
97+
if not split base on /+/
98+
"""
8899

89100
if not vcs_url:
90101
continue
91102

92-
ref = ReferenceV2(
93-
reference_type="commit",
103+
fixed_by_commits = []
104+
repo_url, commit_id = url.split("/+/")
105+
106+
fixed_commit = CodeCommitData(
107+
commit_hash=commit_hash,
94108
url=vcs_url,
95109
)
96-
references.append(ref)
110+
111+
fixed_by_commits.append(fixed_commit)
97112

98113
yield AdvisoryData(
99114
advisory_id=vulnerability_id,
100115
summary=summary,
101116
references_v2=references,
102117
severities=severities,
118+
fixed_by_commits=fixed_by_commits,
103119
date_published=date_published,
104120
url=f"https://raw.githubusercontent.com/quarkslab/aosp_dataset/refs/heads/master/cves/{file_path.name}",
105121
)

0 commit comments

Comments
 (0)