mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 06:34:27 +01:00
fuzz/lnwire: adding fuzz harnesses for all lnwire messages + zlib
This commit is contained in:
20
fuzz/lnwire/commit_sig.go
Normal file
20
fuzz/lnwire/commit_sig.go
Normal file
@@ -0,0 +1,20 @@
|
||||
// +build gofuzz
|
||||
|
||||
package lnwirefuzz
|
||||
|
||||
import (
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
)
|
||||
|
||||
// Fuzz_commit_sig is used by go-fuzz.
|
||||
func Fuzz_commit_sig(data []byte) int {
|
||||
// Prefix with MsgCommitSig.
|
||||
data = prefixWithMsgType(data, lnwire.MsgCommitSig)
|
||||
|
||||
// Create an empty message so that the FuzzHarness func can check
|
||||
// if the max payload constraint is violated.
|
||||
emptyMsg := lnwire.CommitSig{}
|
||||
|
||||
// Pass the message into our general fuzz harness for wire messages!
|
||||
return harness(data, &emptyMsg)
|
||||
}
|
||||
Reference in New Issue
Block a user