Skip to content

Commit f9a3d87

Browse files
committed
tools/syz-aflow/aflow.go: trim KernelRepo url to end with [...].git
1 parent e83a445 commit f9a3d87

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tools/syz-aflow/aflow.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import (
2525
"github.com/google/syzkaller/pkg/osutil"
2626
"github.com/google/syzkaller/pkg/tool"
2727

28+
"strings"
29+
2830
"golang.org/x/oauth2/google"
2931
)
3032

@@ -121,9 +123,17 @@ func downloadBug(id, inputFile, token string) error {
121123
return err
122124
}
123125
crash := info["crashes"].([]any)[0].(map[string]any)
126+
127+
repoURL, _ := crash["kernel-source-git"].(string)
128+
129+
// Clean the URL to end at .git
130+
if dotGitIndex := strings.Index(repoURL, ".git"); dotGitIndex != -1 {
131+
repoURL = repoURL[:dotGitIndex+4]
132+
}
133+
124134
inputs := map[string]any{
125135
"SyzkallerCommit": crash["syzkaller-commit"],
126-
"KernelRepo": crash["kernel-source-git"],
136+
"KernelRepo": repoURL,
127137
"KernelCommit": crash["kernel-source-commit"],
128138
}
129139

0 commit comments

Comments
 (0)