mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-27 09:38:37 +00:00
9c6c4559a7
Add SSH backend that runs commands via SSH. Close #848
22 lines
406 B
Go
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
|
|
}
|