-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
found two panics with go-fuzz from Dmitry Vyukov
go-fuzz-build github.com/cryptix/wav go-fuzz -bin=./wav-fuzz -corpus=./corpus -workdir=~/wdir
- Loading branch information
Showing
10 changed files
with
91 additions
and
4 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// +build gofuzz | ||
|
||
package wav | ||
|
||
import ( | ||
"bytes" | ||
"io" | ||
) | ||
|
||
func Fuzz(data []byte) int { | ||
rd, err := NewReader(bytes.NewReader(data), int64(len(data))) | ||
if err != nil { | ||
if rd != nil { | ||
panic("rd != nil on error") | ||
} | ||
return 0 | ||
} | ||
for { | ||
_, err = rd.ReadSample() | ||
if err != nil { | ||
if err == io.EOF { | ||
break | ||
} | ||
return 0 | ||
} | ||
} | ||
return 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters