xref: /aosp_15_r20/external/golang-protobuf/internal/fuzz/README.md (revision 1c12ee1efe575feb122dbf939ff15148a3b3e8f2)
1*1c12ee1eSDan Willemsen# Fuzzing
2*1c12ee1eSDan Willemsen
3*1c12ee1eSDan WillemsenFuzzing support using [go-fuzz](https://github.com/dvyukov/go-fuzz).
4*1c12ee1eSDan Willemsen
5*1c12ee1eSDan WillemsenBasic operation:
6*1c12ee1eSDan Willemsen
7*1c12ee1eSDan Willemsen```sh
8*1c12ee1eSDan Willemsen$ go install github.com/dvyukov/go-fuzz/go-fuzz
9*1c12ee1eSDan Willemsen$ go install github.com/mdempsky/go114-fuzz-build
10*1c12ee1eSDan Willemsen$ cd internal/fuzz/{fuzzer}
11*1c12ee1eSDan Willemsen$ go114-fuzz-build google.golang.org/protobuf/internal/fuzz/{fuzzer}
12*1c12ee1eSDan Willemsen$ go-fuzz
13*1c12ee1eSDan Willemsen```
14*1c12ee1eSDan Willemsen
15*1c12ee1eSDan Willemsen## OSS-Fuzz
16*1c12ee1eSDan Willemsen
17*1c12ee1eSDan WillemsenFuzzers are automatically run by
18*1c12ee1eSDan Willemsen[OSS-Fuzz](https://github.com/google/oss-fuzz).
19*1c12ee1eSDan Willemsen
20*1c12ee1eSDan WillemsenThe OSS-Fuzz
21*1c12ee1eSDan Willemsen[configuration](https://github.com/google/oss-fuzz/blob/master/projects/golang-protobuf/build.sh)
22*1c12ee1eSDan Willemsencurrently builds fuzzers in every directory under internal/fuzz.
23*1c12ee1eSDan WillemsenOnly add fuzzers (not support packages) in this directory.
24*1c12ee1eSDan Willemsen
25*1c12ee1eSDan WillemsenFuzzing results are available at the [OSS-Fuzz console](https://oss-fuzz.com/),
26*1c12ee1eSDan Willemsenunder `golang-protobuf`.
27