woodpecker/vendor/github.com/pkg/sftp/fuzz.go
qwerty287 9c6c4559a7
Add SSH backend (#861)
Add SSH backend that runs commands via SSH.

Close #848
2022-04-29 12:30:50 +02:00

22 lines
406 B
Go

// +build gofuzz
package sftp
import "bytes"
type sinkfuzz struct{}
func (*sinkfuzz) Close() error { return nil }
func (*sinkfuzz) Write(p []byte) (int, error) { return len(p), nil }
var devnull = &sinkfuzz{}
// To run: go-fuzz-build && go-fuzz
func Fuzz(data []byte) int {
c, err := NewClientPipe(bytes.NewReader(data), devnull)
if err != nil {
return 0
}
c.Close()
return 1
}