Source file src/cmd/cgo/internal/testsanitizers/testdata/libfuzzer1.go

     1  package main
     2  
     3  import "C"
     4  
     5  import "unsafe"
     6  
     7  //export LLVMFuzzerTestOneInput
     8  func LLVMFuzzerTestOneInput(p unsafe.Pointer, sz C.int) C.int {
     9  	b := C.GoBytes(p, sz)
    10  	if len(b) >= 6 && b[0] == 'F' && b[1] == 'u' && b[2] == 'z' && b[3] == 'z' && b[4] == 'M' && b[5] == 'e' {
    11  		panic("found it")
    12  	}
    13  	return 0
    14  }
    15  
    16  func main() {}
    17  

View as plain text