commit
b09846cc89
14
text/fuzz.go
14
text/fuzz.go
|
@ -19,18 +19,18 @@ package text
|
|||
import "bytes"
|
||||
|
||||
// Fuzz text metric parser with with github.com/dvyukov/go-fuzz:
|
||||
//
|
||||
//
|
||||
// go-fuzz-build github.com/prometheus/client_golang/text
|
||||
// go-fuzz -bin text-fuzz.zip -workdir fuzz
|
||||
//
|
||||
// Further input samples should go in the folder fuzz/corpus.
|
||||
func Fuzz(in []byte) int {
|
||||
parser := Parser{}
|
||||
_, err := parser.TextToMetricFamilies(bytes.NewReader(in))
|
||||
parser := Parser{}
|
||||
_, err := parser.TextToMetricFamilies(bytes.NewReader(in))
|
||||
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return 1
|
||||
return 1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue