From 9cea8741b14f6773631609b24027149e86749948 Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 14 Jul 2021 11:17:08 -0400 Subject: [PATCH] fuzz/lnwire: minor touch-ups, remove MaxPayloadLength This commit makes the fuzz/lnwire tests build and run without crashing. --- fuzz/lnwire/accept_channel.go | 11 ++--------- fuzz/lnwire/announce_signatures.go | 6 +----- fuzz/lnwire/channel_announcement.go | 6 +----- fuzz/lnwire/channel_reestablish.go | 6 +----- fuzz/lnwire/channel_update.go | 6 +----- fuzz/lnwire/closing_signed.go | 6 +----- fuzz/lnwire/commit_sig.go | 6 +----- fuzz/lnwire/error.go | 6 +----- fuzz/lnwire/funding_created.go | 6 +----- fuzz/lnwire/funding_locked.go | 6 +----- fuzz/lnwire/funding_signed.go | 6 +----- fuzz/lnwire/fuzz_utils.go | 16 ++++------------ fuzz/lnwire/gossip_timestamp_range.go | 6 +----- fuzz/lnwire/init.go | 6 +----- fuzz/lnwire/node_announcement.go | 14 ++------------ fuzz/lnwire/open_channel.go | 14 ++------------ fuzz/lnwire/ping.go | 6 +----- fuzz/lnwire/pong.go | 6 +----- fuzz/lnwire/query_channel_range.go | 6 +----- fuzz/lnwire/query_short_chan_ids.go | 6 +----- fuzz/lnwire/query_short_chan_ids_zlib.go | 6 +----- fuzz/lnwire/reply_channel_range.go | 6 +----- fuzz/lnwire/reply_channel_range_zlib.go | 6 +----- fuzz/lnwire/reply_short_chan_ids_end.go | 6 +----- fuzz/lnwire/revoke_and_ack.go | 6 +----- fuzz/lnwire/shutdown.go | 6 +----- fuzz/lnwire/update_add_htlc.go | 6 +----- fuzz/lnwire/update_fail_htlc.go | 6 +----- fuzz/lnwire/update_fail_malformed_htlc.go | 6 +----- fuzz/lnwire/update_fee.go | 6 +----- fuzz/lnwire/update_fulfill_htlc.go | 6 +----- 31 files changed, 37 insertions(+), 180 deletions(-) diff --git a/fuzz/lnwire/accept_channel.go b/fuzz/lnwire/accept_channel.go index da8a33ec4..5f20a8584 100644 --- a/fuzz/lnwire/accept_channel.go +++ b/fuzz/lnwire/accept_channel.go @@ -13,10 +13,6 @@ func Fuzz_accept_channel(data []byte) int { // Prefix with MsgAcceptChannel. data = prefixWithMsgType(data, lnwire.MsgAcceptChannel) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.AcceptChannel{} - // We have to do this here instead of in fuzz.Harness so that // reflect.DeepEqual isn't called. Because of the UpfrontShutdownScript // encoding, the first message and second message aren't deeply equal since @@ -26,12 +22,9 @@ func Fuzz_accept_channel(data []byte) int { r := bytes.NewReader(data) // Make sure byte array length (excluding 2 bytes for message type) is - // less than max payload size for the wire message. We check this because - // otherwise `go-fuzz` will keep creating inputs that crash on ReadMessage - // due to a large message size. + // less than max payload size for the wire message. payloadLen := uint32(len(data)) - 2 - if payloadLen > emptyMsg.MaxPayloadLength(0) { - // Ignore this input - max payload constraint violated. + if payloadLen > lnwire.MaxMsgBody { return 1 } diff --git a/fuzz/lnwire/announce_signatures.go b/fuzz/lnwire/announce_signatures.go index 048cf5abe..68263786a 100644 --- a/fuzz/lnwire/announce_signatures.go +++ b/fuzz/lnwire/announce_signatures.go @@ -11,10 +11,6 @@ func Fuzz_announce_signatures(data []byte) int { // Prefix with MsgAnnounceSignatures. data = prefixWithMsgType(data, lnwire.MsgAnnounceSignatures) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.AnnounceSignatures{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/channel_announcement.go b/fuzz/lnwire/channel_announcement.go index 771df5d1c..2b0c2ff0d 100644 --- a/fuzz/lnwire/channel_announcement.go +++ b/fuzz/lnwire/channel_announcement.go @@ -11,10 +11,6 @@ func Fuzz_channel_announcement(data []byte) int { // Prefix with MsgChannelAnnouncement. data = prefixWithMsgType(data, lnwire.MsgChannelAnnouncement) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.ChannelAnnouncement{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/channel_reestablish.go b/fuzz/lnwire/channel_reestablish.go index 08cca9a56..324f0afc3 100644 --- a/fuzz/lnwire/channel_reestablish.go +++ b/fuzz/lnwire/channel_reestablish.go @@ -11,10 +11,6 @@ func Fuzz_channel_reestablish(data []byte) int { // Prefix with MsgChannelReestablish. data = prefixWithMsgType(data, lnwire.MsgChannelReestablish) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.ChannelReestablish{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/channel_update.go b/fuzz/lnwire/channel_update.go index 993181f7b..29bb7d377 100644 --- a/fuzz/lnwire/channel_update.go +++ b/fuzz/lnwire/channel_update.go @@ -11,10 +11,6 @@ func Fuzz_channel_update(data []byte) int { // Prefix with MsgChannelUpdate. data = prefixWithMsgType(data, lnwire.MsgChannelUpdate) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.ChannelUpdate{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/closing_signed.go b/fuzz/lnwire/closing_signed.go index b6898a7cb..7ecf96aa1 100644 --- a/fuzz/lnwire/closing_signed.go +++ b/fuzz/lnwire/closing_signed.go @@ -11,10 +11,6 @@ func Fuzz_closing_signed(data []byte) int { // Prefix with MsgClosingSigned. data = prefixWithMsgType(data, lnwire.MsgClosingSigned) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.ClosingSigned{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/commit_sig.go b/fuzz/lnwire/commit_sig.go index 6f9c76ec1..7133f1147 100644 --- a/fuzz/lnwire/commit_sig.go +++ b/fuzz/lnwire/commit_sig.go @@ -11,10 +11,6 @@ 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) + return harness(data) } diff --git a/fuzz/lnwire/error.go b/fuzz/lnwire/error.go index 8b5dd671a..37481f078 100644 --- a/fuzz/lnwire/error.go +++ b/fuzz/lnwire/error.go @@ -11,10 +11,6 @@ func Fuzz_error(data []byte) int { // Prefix with MsgError. data = prefixWithMsgType(data, lnwire.MsgError) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.Error{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/funding_created.go b/fuzz/lnwire/funding_created.go index ffdb3390a..bb37869c7 100644 --- a/fuzz/lnwire/funding_created.go +++ b/fuzz/lnwire/funding_created.go @@ -11,10 +11,6 @@ func Fuzz_funding_created(data []byte) int { // Prefix with MsgFundingCreated. data = prefixWithMsgType(data, lnwire.MsgFundingCreated) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.FundingCreated{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/funding_locked.go b/fuzz/lnwire/funding_locked.go index aa5d2c26d..1144225e3 100644 --- a/fuzz/lnwire/funding_locked.go +++ b/fuzz/lnwire/funding_locked.go @@ -11,10 +11,6 @@ func Fuzz_funding_locked(data []byte) int { // Prefix with MsgFundingLocked. data = prefixWithMsgType(data, lnwire.MsgFundingLocked) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.FundingLocked{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/funding_signed.go b/fuzz/lnwire/funding_signed.go index 47f2bfd06..f3a11cef2 100644 --- a/fuzz/lnwire/funding_signed.go +++ b/fuzz/lnwire/funding_signed.go @@ -11,10 +11,6 @@ func Fuzz_funding_signed(data []byte) int { // Prefix with MsgFundingSigned. prefixWithMsgType(data, lnwire.MsgFundingSigned) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.FundingSigned{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/fuzz_utils.go b/fuzz/lnwire/fuzz_utils.go index 7ffdd1816..fda7517e5 100644 --- a/fuzz/lnwire/fuzz_utils.go +++ b/fuzz/lnwire/fuzz_utils.go @@ -24,25 +24,18 @@ func prefixWithMsgType(data []byte, prefix lnwire.MessageType) []byte { // is a valid message once deserialized, and passes a sequence of serialization // and deserialization checks. Returns an int that determines whether the input // is unique or not. -func harness(data []byte, emptyMsg lnwire.Message) int { +func harness(data []byte) int { // Create a reader with the byte array. r := bytes.NewReader(data) - // Make sure byte array length (excluding 2 bytes for message type) is - // less than max payload size for the wire message. We check this because - // otherwise `go-fuzz` will keep creating inputs that crash on ReadMessage - // due to a large message size. - payloadLen := uint32(len(data)) - 2 - if payloadLen > emptyMsg.MaxPayloadLength(0) { - // Ignore this input - max payload constraint violated. + // Check that the created message is not greater than the maximum + // message size. + if len(data) > lnwire.MaxSliceLength { return 1 } msg, err := lnwire.ReadMessage(r, 0) if err != nil { - // go-fuzz generated []byte that cannot be represented as a - // wire message but we will return 0 so go-fuzz can modify the - // input. return 1 } @@ -67,6 +60,5 @@ func harness(data []byte, emptyMsg lnwire.Message) int { panic("original message and deserialized message are not deeply equal") } - // Add this input to the corpus. return 1 } diff --git a/fuzz/lnwire/gossip_timestamp_range.go b/fuzz/lnwire/gossip_timestamp_range.go index 9e5e4f11a..da56594c9 100644 --- a/fuzz/lnwire/gossip_timestamp_range.go +++ b/fuzz/lnwire/gossip_timestamp_range.go @@ -11,10 +11,6 @@ func Fuzz_gossip_timestamp_range(data []byte) int { // Prefix with MsgGossipTimestampRange. data = prefixWithMsgType(data, lnwire.MsgGossipTimestampRange) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.GossipTimestampRange{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/init.go b/fuzz/lnwire/init.go index b2be1aba3..3f0c0c806 100644 --- a/fuzz/lnwire/init.go +++ b/fuzz/lnwire/init.go @@ -11,10 +11,6 @@ func Fuzz_init(data []byte) int { // Prefix with MsgInit. data = prefixWithMsgType(data, lnwire.MsgInit) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.Init{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/node_announcement.go b/fuzz/lnwire/node_announcement.go index 63b2c9aad..8826e0264 100644 --- a/fuzz/lnwire/node_announcement.go +++ b/fuzz/lnwire/node_announcement.go @@ -14,10 +14,6 @@ func Fuzz_node_announcement(data []byte) int { // Prefix with MsgNodeAnnouncement. data = prefixWithMsgType(data, lnwire.MsgNodeAnnouncement) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.NodeAnnouncement{} - // We have to do this here instead of in fuzz.Harness so that // reflect.DeepEqual isn't called. Address (de)serialization messes up // the fuzzing assertions. @@ -26,20 +22,14 @@ func Fuzz_node_announcement(data []byte) int { r := bytes.NewReader(data) // Make sure byte array length (excluding 2 bytes for message type) is - // less than max payload size for the wire message. We check this because - // otherwise `go-fuzz` will keep creating inputs that crash on ReadMessage - // due to a large message size. + // less than max payload size for the wire message. payloadLen := uint32(len(data)) - 2 - if payloadLen > emptyMsg.MaxPayloadLength(0) { - // Ignore this input - max payload constraint violated. + if payloadLen > lnwire.MaxMsgBody { return 1 } msg, err := lnwire.ReadMessage(r, 0) if err != nil { - // go-fuzz generated []byte that cannot be represented as a - // wire message but we will return 0 so go-fuzz can modify the - // input. return 1 } diff --git a/fuzz/lnwire/open_channel.go b/fuzz/lnwire/open_channel.go index 2cc7c4acc..4942c5b67 100644 --- a/fuzz/lnwire/open_channel.go +++ b/fuzz/lnwire/open_channel.go @@ -13,10 +13,6 @@ func Fuzz_open_channel(data []byte) int { // Prefix with MsgOpenChannel. data = prefixWithMsgType(data, lnwire.MsgOpenChannel) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.OpenChannel{} - // We have to do this here instead of in fuzz.Harness so that // reflect.DeepEqual isn't called. Because of the UpfrontShutdownScript // encoding, the first message and second message aren't deeply equal since @@ -26,20 +22,14 @@ func Fuzz_open_channel(data []byte) int { r := bytes.NewReader(data) // Make sure byte array length (excluding 2 bytes for message type) is - // less than max payload size for the wire message. We check this because - // otherwise `go-fuzz` will keep creating inputs that crash on ReadMessage - // due to a large message size. + // less than max payload size for the wire message. payloadLen := uint32(len(data)) - 2 - if payloadLen > emptyMsg.MaxPayloadLength(0) { - // Ignore this input - max payload constraint violated. + if payloadLen > lnwire.MaxMsgBody { return 1 } msg, err := lnwire.ReadMessage(r, 0) if err != nil { - // go-fuzz generated []byte that cannot be represented as a - // wire message but we will return 0 so go-fuzz can modify the - // input. return 1 } diff --git a/fuzz/lnwire/ping.go b/fuzz/lnwire/ping.go index 87e893e06..4cdb629e0 100644 --- a/fuzz/lnwire/ping.go +++ b/fuzz/lnwire/ping.go @@ -11,10 +11,6 @@ func Fuzz_ping(data []byte) int { // Prefix with MsgPing. data = prefixWithMsgType(data, lnwire.MsgPing) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.Ping{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/pong.go b/fuzz/lnwire/pong.go index b51e31524..31df6ca3e 100644 --- a/fuzz/lnwire/pong.go +++ b/fuzz/lnwire/pong.go @@ -11,10 +11,6 @@ func Fuzz_pong(data []byte) int { // Prefix with MsgPong. data = prefixWithMsgType(data, lnwire.MsgPong) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.Pong{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/query_channel_range.go b/fuzz/lnwire/query_channel_range.go index 38f5f4d7b..87b69afb4 100644 --- a/fuzz/lnwire/query_channel_range.go +++ b/fuzz/lnwire/query_channel_range.go @@ -11,10 +11,6 @@ func Fuzz_query_channel_range(data []byte) int { // Prefix with MsgQueryChannelRange. data = prefixWithMsgType(data, lnwire.MsgQueryChannelRange) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.QueryChannelRange{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/query_short_chan_ids.go b/fuzz/lnwire/query_short_chan_ids.go index b0adb8792..8830eea3b 100644 --- a/fuzz/lnwire/query_short_chan_ids.go +++ b/fuzz/lnwire/query_short_chan_ids.go @@ -11,10 +11,6 @@ func Fuzz_query_short_chan_ids(data []byte) int { // Prefix with MsgQueryShortChanIDs. data = prefixWithMsgType(data, lnwire.MsgQueryShortChanIDs) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.QueryShortChanIDs{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/query_short_chan_ids_zlib.go b/fuzz/lnwire/query_short_chan_ids_zlib.go index 7b2061d77..2d2573664 100644 --- a/fuzz/lnwire/query_short_chan_ids_zlib.go +++ b/fuzz/lnwire/query_short_chan_ids_zlib.go @@ -42,10 +42,6 @@ func Fuzz_query_short_chan_ids_zlib(data []byte) int { // Prefix with MsgQueryShortChanIDs. payload = prefixWithMsgType(payload, lnwire.MsgQueryShortChanIDs) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.QueryShortChanIDs{} - // Pass the message into our general fuzz harness for wire messages! - return harness(payload, &emptyMsg) + return harness(payload) } diff --git a/fuzz/lnwire/reply_channel_range.go b/fuzz/lnwire/reply_channel_range.go index 3bfdbf362..8a2d7f13c 100644 --- a/fuzz/lnwire/reply_channel_range.go +++ b/fuzz/lnwire/reply_channel_range.go @@ -11,10 +11,6 @@ func Fuzz_reply_channel_range(data []byte) int { // Prefix with MsgReplyChannelRange. data = prefixWithMsgType(data, lnwire.MsgReplyChannelRange) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.ReplyChannelRange{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/reply_channel_range_zlib.go b/fuzz/lnwire/reply_channel_range_zlib.go index 944d1fa1a..af04efd54 100644 --- a/fuzz/lnwire/reply_channel_range_zlib.go +++ b/fuzz/lnwire/reply_channel_range_zlib.go @@ -50,10 +50,6 @@ func Fuzz_reply_channel_range_zlib(data []byte) int { // Prefix with MsgReplyChannelRange. payload = prefixWithMsgType(payload, lnwire.MsgReplyChannelRange) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.ReplyChannelRange{} - // Pass the message into our general fuzz harness for wire messages! - return harness(payload, &emptyMsg) + return harness(payload) } diff --git a/fuzz/lnwire/reply_short_chan_ids_end.go b/fuzz/lnwire/reply_short_chan_ids_end.go index c09282d9a..7e5c96570 100644 --- a/fuzz/lnwire/reply_short_chan_ids_end.go +++ b/fuzz/lnwire/reply_short_chan_ids_end.go @@ -11,10 +11,6 @@ func Fuzz_reply_short_chan_ids_end(data []byte) int { // Prefix with MsgReplyShortChanIDsEnd. data = prefixWithMsgType(data, lnwire.MsgReplyShortChanIDsEnd) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.ReplyShortChanIDsEnd{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/revoke_and_ack.go b/fuzz/lnwire/revoke_and_ack.go index 23951c356..bab5d118b 100644 --- a/fuzz/lnwire/revoke_and_ack.go +++ b/fuzz/lnwire/revoke_and_ack.go @@ -11,10 +11,6 @@ func Fuzz_revoke_and_ack(data []byte) int { // Prefix with MsgRevokeAndAck. data = prefixWithMsgType(data, lnwire.MsgRevokeAndAck) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.RevokeAndAck{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/shutdown.go b/fuzz/lnwire/shutdown.go index 1ffd86606..5e855b713 100644 --- a/fuzz/lnwire/shutdown.go +++ b/fuzz/lnwire/shutdown.go @@ -11,10 +11,6 @@ func Fuzz_shutdown(data []byte) int { // Prefix with MsgShutdown. data = prefixWithMsgType(data, lnwire.MsgShutdown) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.Shutdown{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/update_add_htlc.go b/fuzz/lnwire/update_add_htlc.go index 570de7418..2ea7b4af2 100644 --- a/fuzz/lnwire/update_add_htlc.go +++ b/fuzz/lnwire/update_add_htlc.go @@ -11,10 +11,6 @@ func Fuzz_update_add_htlc(data []byte) int { // Prefix with MsgUpdateAddHTLC. data = prefixWithMsgType(data, lnwire.MsgUpdateAddHTLC) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.UpdateAddHTLC{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/update_fail_htlc.go b/fuzz/lnwire/update_fail_htlc.go index 4ef9ab88d..33cd9b1ff 100644 --- a/fuzz/lnwire/update_fail_htlc.go +++ b/fuzz/lnwire/update_fail_htlc.go @@ -11,10 +11,6 @@ func Fuzz_update_fail_htlc(data []byte) int { // Prefix with MsgUpdateFailHTLC. data = prefixWithMsgType(data, lnwire.MsgUpdateFailHTLC) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.UpdateFailHTLC{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/update_fail_malformed_htlc.go b/fuzz/lnwire/update_fail_malformed_htlc.go index 0a0d45a6f..d7dc97680 100644 --- a/fuzz/lnwire/update_fail_malformed_htlc.go +++ b/fuzz/lnwire/update_fail_malformed_htlc.go @@ -11,10 +11,6 @@ func Fuzz_update_fail_malformed_htlc(data []byte) int { // Prefix with MsgUpdateFailMalformedHTLC. data = prefixWithMsgType(data, lnwire.MsgUpdateFailMalformedHTLC) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.UpdateFailMalformedHTLC{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/update_fee.go b/fuzz/lnwire/update_fee.go index bb82c5c19..cdb045689 100644 --- a/fuzz/lnwire/update_fee.go +++ b/fuzz/lnwire/update_fee.go @@ -11,10 +11,6 @@ func Fuzz_update_fee(data []byte) int { // Prefix with MsgUpdateFee. data = prefixWithMsgType(data, lnwire.MsgUpdateFee) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.UpdateFee{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) } diff --git a/fuzz/lnwire/update_fulfill_htlc.go b/fuzz/lnwire/update_fulfill_htlc.go index de28dfbe1..6887cac83 100644 --- a/fuzz/lnwire/update_fulfill_htlc.go +++ b/fuzz/lnwire/update_fulfill_htlc.go @@ -11,10 +11,6 @@ func Fuzz_update_fulfill_htlc(data []byte) int { // Prefix with MsgUpdateFulfillHTLC. data = prefixWithMsgType(data, lnwire.MsgUpdateFulfillHTLC) - // Create an empty message so that the FuzzHarness func can check - // if the max payload constraint is violated. - emptyMsg := lnwire.UpdateFulfillHTLC{} - // Pass the message into our general fuzz harness for wire messages! - return harness(data, &emptyMsg) + return harness(data) }