github.com/decred/dcrlnd@v0.7.6/fuzz/wtwire/create_session.go (about)

     1  //go:build gofuzz
     2  // +build gofuzz
     3  
     4  package wtwirefuzz
     5  
     6  import (
     7  	"github.com/decred/dcrlnd/watchtower/wtwire"
     8  )
     9  
    10  // Fuzz_create_session is used by go-fuzz.
    11  func Fuzz_create_session(data []byte) int {
    12  	// Prefix with MsgCreateSession.
    13  	data = prefixWithMsgType(data, wtwire.MsgCreateSession)
    14  
    15  	// Create an empty message so that the FuzzHarness func can check if the
    16  	// max payload constraint is violated.
    17  	emptyMsg := wtwire.CreateSession{}
    18  
    19  	// Pass the message into our general fuzz harness for wire messages!
    20  	return harness(data, &emptyMsg)
    21  }