From 62dbd414b7dbebb3b2d2db907bd45297c5a08822 Mon Sep 17 00:00:00 2001 From: Rob Heaton Date: Mon, 6 Aug 2018 11:20:09 -0700 Subject: [PATCH] Fix bug in fuzzer ID length --- client/main.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/main.go b/client/main.go index bb38ba0..656b3fc 100644 --- a/client/main.go +++ b/client/main.go @@ -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 }