Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,14 @@ func init() {

func usableHostName(orig string) (valid string) {
valid = invalidFuzzerNames.ReplaceAllString(orig, "_")
// fuzzer name is ${hostname}-xxxx, so this string can be max 29 chars
if len(valid) > 29 {
valid = valid[0:29]
// Max AFL fuzzer ID length is 32:
// https://github.com/mirrorer/afl/blob/2fb5a3482ec27b593c57258baae7089ebdc89043/afl-fuzz.c#L7456
//
// Our fuzzer ID is ${hostname}-xxxx, so the hostname portion can
// be max 32 - 5 = 27 chars.
maxHostnameLen := 27
if len(valid) > maxHostnameLen {
valid = valid[0:maxHostnameLen]
}
return
}
Expand Down