Skip to content
This repository was archived by the owner on Apr 30, 2021. It is now read-only.

Commit 649474e

Browse files
author
Yevgeny Pats
committed
bugfix in parsing additional args for libFuzzer
1 parent b709f60 commit 649474e

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

client/agent.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (c *FuzzitClient) runLibFuzzerFuzzing() error {
201201
)
202202

203203
if c.currentJob.Args != "" {
204-
args = append(args, strings.Split(c.currentJob.Args, " ")...)
204+
args = append(args, splitAndRemoveEmpty(c.currentJob.Args, " ")...)
205205
}
206206

207207
var err error
@@ -319,7 +319,7 @@ func (c *FuzzitClient) runLibFuzzerRegression() error {
319319
regressionFiles...,
320320
)
321321
if c.currentJob.Args != "" {
322-
args = append(args, strings.Split(c.currentJob.Args, " ")...)
322+
args = append(args, splitAndRemoveEmpty(c.currentJob.Args, " ")...)
323323
}
324324

325325
log.Println("Running regression...")
@@ -419,7 +419,7 @@ func (c *FuzzitClient) RunJQFFuzzing() error {
419419
"fuzzer",
420420
}
421421
if c.currentJob.Args != "" {
422-
args = append(args, strings.Split(c.currentJob.Args, " ")...)
422+
args = append(args, splitAndRemoveEmpty(c.currentJob.Args, " ")...)
423423
}
424424

425425
path, err := exec.LookPath("java")

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
const FuzzitEndpoint = "https://app.fuzzit.dev"
14-
const Version = "v2.4.63"
14+
const Version = "v2.4.64"
1515

1616
type Target struct {
1717
Name string `firestore:"target_name"`

client/utils.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"os/user"
99
"path"
1010
"path/filepath"
11+
"strings"
1112
)
1213

1314
func getCacheFile() (string, error) {
@@ -24,6 +25,18 @@ func getCacheFile() (string, error) {
2425
return cacheFile, nil
2526
}
2627

28+
func splitAndRemoveEmpty(s string, delimiter string) []string {
29+
splitted := strings.Split(s, delimiter)
30+
var withoutEmptyStrings []string
31+
for _, str := range splitted {
32+
if str != "" {
33+
withoutEmptyStrings = append(withoutEmptyStrings, str)
34+
}
35+
}
36+
37+
return withoutEmptyStrings
38+
}
39+
2740
func GetValueFromEnv(variables ...string) string {
2841
for _, env := range variables {
2942
value := os.Getenv(env)

0 commit comments

Comments
 (0)