fuzz-walker/walker/walkers/writeBytesFuzz/plugin.go

33 lines
514 B
Go
Raw Normal View History

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