ipld-eth-server/vendor/github.com/multiformats/go-multistream/multistream_fuzz.go
Elizabeth Engelman 36533f7c3f Update vendor directory and make necessary code changes
Fixes for new geth version
2019-09-25 16:32:27 -05:00

29 lines
407 B
Go

// +build gofuzz
package multistream
import "bytes"
type rwc struct {
*bytes.Reader
}
func (*rwc) Write(b []byte) (int, error) {
return len(b), nil
}
func (*rwc) Close() error {
return nil
}
func Fuzz(b []byte) int {
readStream := bytes.NewReader(b)
input := &rwc{readStream}
mux := NewMultistreamMuxer()
mux.AddHandler("/a", nil)
mux.AddHandler("/b", nil)
_ = mux.Handle(input)
return 1
}