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

Commit 4e0cfc6

Browse files
author
Yevgeny Pats
committed
bugfix in go-fuzz engine
1 parent eea8d34 commit 4e0cfc6

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

client/client.go

+1-1
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.67"
14+
const Version = "v2.4.68"
1515

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

client/commands.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ func (c *FuzzitClient) CreateJob(jobConfig Job, files []string) (*firestore.Docu
310310

311311
fuzzerPath := files[0]
312312
filename := filepath.Base(fuzzerPath)
313-
if !strings.HasSuffix(filename, ".tar.gz") {
313+
if !strings.HasSuffix(filename, ".tar.gz") && jobConfig.Engine != "go-fuzz" {
314314
tmpDir, err := ioutil.TempDir("", "fuzzit")
315315
if err != nil {
316316
return nil, err

client/utils.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,12 @@ func catLastBytes(path string, lastBytes int64) error {
5050

5151
buf := make([]byte, lastBytes)
5252
stat, err := os.Stat(path)
53-
start := stat.Size() - lastBytes
54-
_, err = fh.ReadAt(buf, start)
53+
start := 0
54+
if stat.Size() > lastBytes {
55+
start = int(stat.Size() - lastBytes)
56+
}
57+
58+
_, err = fh.ReadAt(buf, int64(start))
5559
if err != nil {
5660
return err
5761
}

0 commit comments

Comments
 (0)