lnwire: add custom message to fuzz tests

This commit is contained in:
ziggie 2023-01-08 00:07:35 +01:00
parent 35caaf3c53
commit 88a8c6618d
No known key found for this signature in database
GPG Key ID: 1AFF9C4DCED6D666

View File

@ -807,3 +807,18 @@ func FuzzUpdateFulfillHTLC(f *testing.F) {
harness(t, data)
})
}
func FuzzCustomMessage(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte, customMessageType uint16) {
if customMessageType < uint16(CustomTypeStart) {
customMessageType += uint16(CustomTypeStart)
}
// Prefix with CustomMessage.
data = prefixWithMsgType(data, MessageType(customMessageType))
// Pass the message into our general fuzz harness for wire
// messages!
harness(t, data)
})
}