...

Source file src/github.com/mdlayher/ethernet/fuzz.go

Documentation: github.com/mdlayher/ethernet

     1  //go:build gofuzz
     2  // +build gofuzz
     3  
     4  package ethernet
     5  
     6  func Fuzz(data []byte) int {
     7  	f := new(Frame)
     8  	if err := f.UnmarshalBinary(data); err != nil {
     9  		return 0
    10  	}
    11  
    12  	if _, err := f.MarshalBinary(); err != nil {
    13  		panic(err)
    14  	}
    15  
    16  	if err := f.UnmarshalFCS(data); err != nil {
    17  		return 0
    18  	}
    19  
    20  	if _, err := f.MarshalFCS(); err != nil {
    21  		panic(err)
    22  	}
    23  
    24  	return 1
    25  }
    26  

View as plain text