Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: simplify small bits of code #40

Merged
merged 1 commit into from Sep 10, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -88,15 +88,15 @@ func (c *FuzzitClient) runlibFuzzerMerge() error {
return err
}
}
args := append([]string{
args := []string{
"-print_final_stats=1",
"-exact_artifact_path=./artifact",
fmt.Sprintf("-error_exitcode=%d", libFuzzerTimeoutExitCode),
"-merge_control_file=/tmp/merge_control.txt",
"-merge=1",
"merge",
"corpus",
})
}

log.Println("Running merge with: ./fuzzer " + strings.Join(args, " "))
cmd := exec.Command("./fuzzer",
@@ -164,14 +164,14 @@ func (c *FuzzitClient) uploadCrash(exitCode int) error {
func (c *FuzzitClient) runLibFuzzerFuzzing() error {
ctx := context.Background()

args := append([]string{
args := []string{
"-print_final_stats=1",
"-exact_artifact_path=./artifact",
"-error_exitcode=76",
"-max_total_time=3600",
"corpus",
"seed",
})
}

var err error
err = nil
@@ -189,7 +189,7 @@ func (c *FuzzitClient) runLibFuzzerFuzzing() error {
go func() { done <- cmd.Wait() }()
timeout := time.After(60 * time.Second)
stopSession := false
for stopSession == false {
for !stopSession {
select {
case <-timeout:
var fuzzingJob job
@@ -143,10 +143,8 @@ func (c *FuzzitClient) downloadAndExtract(dirPath string, storagePath string) er
switch kind.MIME.Value {
case "application/gzip":
unarchiver = archiver.NewTarGz()
break
case "application/zip":
unarchiver = archiver.NewZip()
break
default:
// assume executable
if _, err := copyFile(filepath.Join(dirPath, "fuzzer"), tmpArchiveFile.Name()); err != nil {
@@ -155,8 +153,7 @@ func (c *FuzzitClient) downloadAndExtract(dirPath string, storagePath string) er
return nil
}

err = unarchiver.Unarchive(tmpArchiveFile.Name(), dirPath)
if err != nil {
if err := unarchiver.Unarchive(tmpArchiveFile.Name(), dirPath); err != nil {
return err
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.