2018-06-06 14:42:39 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"git.thisco.de/vbatts/fuzz-walker/walker"
|
|
|
|
)
|
|
|
|
|
2018-06-06 15:21:08 +00:00
|
|
|
// NewFuzzer creates the fuzzer for this plugin
|
2018-06-06 14:42:39 +00:00
|
|
|
func NewFuzzer() (walker.Fuzzer, error) {
|
|
|
|
return &myFuzzer{}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
type myFuzzer struct{}
|
|
|
|
|
|
|
|
func (mf myFuzzer) Name() string {
|
2018-06-06 15:21:08 +00:00
|
|
|
return "writeBytesFuzz"
|
2018-06-06 14:42:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (mf myFuzzer) Func(path string, info os.FileInfo, timeout time.Duration) error {
|
2018-06-06 15:21:08 +00:00
|
|
|
if !info.Mode().IsRegular() {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
fd, err := os.Open(path)
|
|
|
|
if err != nil {
|
2018-06-06 14:42:39 +00:00
|
|
|
return err
|
|
|
|
}
|
2018-06-06 15:21:08 +00:00
|
|
|
defer fd.Close()
|
|
|
|
|
2018-06-06 14:42:39 +00:00
|
|
|
return nil
|
|
|
|
}
|